TransWikia.com

Can repeatedly encrypting a message with a secure cipher ever produce the original input like what happens in ROT13?

Cryptography Asked by CM9 on November 8, 2021

Lets say we have a message ‘m’.
We encrypt ‘m’ using a stream cipher or any other type of cipher with cryptographic security that produces an output equal in length to the length of ‘m’.
Then if we keep on on re-encrypting the output with same cipher (but different key each round) for eternity, what are the chances of it ever producing ‘m’ as the cipher-text.

One Answer

If the ciphertext is the same size as the plaintext, then yes with 100% probability.

There are only finitely many values the ciphertext can take. So repeatedly encrypting the ciphertext, means that a value must repeat eventually. If this cycle doesn't include the original message, then there is some ciphertext that has an ambiguous decryption (because two plaintexts encrypt to it). Since we know this isn't the case, the original message must be in the cycle.


You can easily tweak this argument to ignore padding (just take the padded message as your original message).

If the encryption scheme requires an IV/nonce, then this argument only applies if you reuse the same IV for each encryption, in other words, after the first encryption, the ciphertext size is constant.

I highly doubt there's a way to show this with an authenticated encryption scheme.

Answered by Aman Grewal on November 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP