Imagine an Encryption Algorithm which applies a classic Shift Cipher (also called Caesar or ROT-X) to a text (with only lowercase [a-z] and the space ' ' character), but has one parameter r (randomness) to decide if in each round/iteration attempting to encrypt one char c, it encrypts the character c+key, or if it inserts a completely random character rchar and repeats next iteration with the same non-encrypted yet character c.

For example, with a plaintext ptext=hello, r=0.20, and key=1, the encryption algorithm will output ctext=ifrmmp where every char was shifted by 1 position but 1 new random character was added (since 20% is 1 of each 5, and hello has 5 chars, I assume only one time the condition of adding a random char was true).

Now imagine that you have a dictionary dict of U=10 plaintexts of length L=500, and you need to decide, from a ciphertext input ctext, which one of the plaintext ptext from the dictionary dict corresponds to the given ciphertext.

A regular approach would be to do Frequency Analysis, but with a high value of r (>10/15 %) the results are not consistent.

Is this encryption algorithm unbreakable? Or is there a way to consistently guess the correct plaintext?


1 Answer 1


Frequency analysis would still apply albeit larger quantities of ciphertext might be required.

If your system is to introduce a random character with probability $p$ and the plaintext frequency of a given letter is $q$, then the ciphertext frequency of its shift will be $(1-p)q+p/26$ and if $q\neq 1/26$ this is still distinguishable from uniform. In particular, common letter will continue to have a frequency above 1/26 and uncommon letters a frequency below 1/26.

There is the added complication that it is not clear that you system is able to be decrypted unambiguously. How should I interpret a message that after unshifting reads ICATNOFFENRYOUSOMEVICEWICTHYOURGINABNDTONXIC?

If there is a systematic way to determine which characters are random inserts, then this is an example of a null cipher.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.