# What effect does adding noise to a substitution cipher have?

Assume I assigned the letters A-Z to random numbers in the range of 0-100. The mapping of plaintext characters to ciphertext values constitutes my cipher alphabet(and key).

I encrypt a message using a normal substitution cipher. I then create a sequence of random values the same length as my initial ciphertext using numbers in the range of 0-100 that were not used in my cipher alphabet. I then randomly weave my initial cipher text and my random sequence together.

Specifically, I would start with the first ciphertext character and randomly decide wether or not to add noise. If I decide to add noise I will insert the first unused element from my random sequence either before or after the current ciphertext character (again chosen randomly). When I reach the end of the cipher text there may still be unused values from the random sequence. If there are I go back to the first character of ciphertext (which could be an encrypted value or noise added in a previous pass) and continue inserting values randomly until all of the values from the random sequence have been used.

The final result is the message that would be transmitted. If you know the key description is trivial since you can just ignore the "noise". But if you don't know the key how would you go about decrypting this? specifically what are the techniques for separating noise from meaningful data or is there some other attack scheme?

Note: I am asking because of hobbyist curiosity. I know modern encryption algorithms are secure and don't need to be meddled with. And I know the scenario I described results in a larger transmission, etc. I just want to know how you break it.

• Have you considered that a bit of noise is like a bit of a stream cipher? – Paul Uszak May 5 '18 at 10:55

I did some simulations and found that after adding noise, the common English letters (e, a, t, r, s, etc) still stuck out like sore thumbs. Knowing which characters represent these letters, and assuming the attacker knows we added noise, makes this only trivially harder than a straight substitution attack.

But that got me thinking, what if for each letter A-Z I choose some random amount of random numbers to represent that letter. Each random sequence must be uniquely identifiable when concatenated with any other value (I don't know an easy way to generate this kind of key but its possible to construct manually if your careful). For example I could choose the following values for A, B, and C:

A: 36 52 47
B: 36
C: 95 47


Given the string "36 52 47 95 47 95 47 36 52 46 36" we can tell that it represents the characters "ACCAB", but without knowing the key, frequency analysis wouldn't work (for example B shows up once in our plaintext, but its corresponding cipher text value 36 shows up three times).

I don't know if this type of cypheralphabet has a name, but I realized that on its own, it isn't that strong. We can look at the frequency of pairs of numbers in the ciphertext and determine what numbers are more likely part of the same character representation. If you can split the numbers up correctly, then this is the same as a standard substitution cipher.

But if we add noise to this weird random character length cipher alphabet, in the same way it was originally described, then there is no way I can see to determine which groups of numbers represent single characters, and basic frequency analysis doesn't work. What am I missing?

• Nevermind, someone can close this topic (sorry im new to SO don't know how everything works). After more simulations I found that none of the approaches are immune to frequency analysis. By looking at the frequency of pairs it's pretty much always possible to detect the noise with these schemes. – Jack Hoffman May 5 '18 at 11:21