Let say that I wrote a 26 letter alphabet, each letter of my alphabet represent a letter from the latin alphabet.

I'm writing in 3 languages, only I know which languages. Grammar is the one from my native language.

Each time I need to write a word I randomly chooses in which language I'm going to write it.

Can you actually break this code using Frequency analysis?


example :


The sentence :

this is a cherry tree

becomes :

ceci is a sakura

[fr] [en] [en] [jp]

and once encoded :

cfch gi x oxirax
  • 1
    $\begingroup$ I can probably break it by using Google Translate to translate each word into English. It's pretty good at auto detecting the language of a word. $\endgroup$
    – Bill Barth
    Jul 19, 2013 at 16:42
  • 2
    $\begingroup$ Given the issue of "break[ing] this code using Frequency analysis", I suspect the OP means that a substitution cypher is to be applied uniformly to the words, regardless of which language they are from. It's unlikely Google Translate could reliably detect the language from such encoded words. $\endgroup$
    – hardmath
    Jul 19, 2013 at 17:04
  • $\begingroup$ Could be, but "Each time I need to write a word I randomly chooses in which language I'm going to write it." seems to imply word swaps not letter swaps. Perhaps @sliders_alpha can clarify. $\endgroup$
    – Bill Barth
    Jul 19, 2013 at 19:49
  • $\begingroup$ I'm not sure this question fits well into SciComp. Or rather, I don't know that many current SciComp users will answer this question, and you might be able to get a better quality answer at Crypto.SE. $\endgroup$
    – Geoff Oxberry
    Jul 21, 2013 at 8:42
  • 1
    $\begingroup$ But even with a lot of text there is still one difficulty, each time I RANDOMLY choose the language, meaning I won't always use the same language for the same word $\endgroup$ Dec 5, 2013 at 15:10

2 Answers 2


Yes, we can almost certainly break this, given enough ciphertext.

One approach would be to use a dictionary and use word patterns. For instance, if the ciphertext word is qddxfozogf, then the plaintext word was probably ammunition. Notice how the 2nd and 3rd letters are the same; and the 5th and 10th letters, and the 6th and 8th letters? The word ammunition is essentially the only word that has this special pattern. One could expect that some fraction of words will be essentially unique, in their pattern of repetition. With enough ciphertext, you'll be able to uniquely recover one or more of the words, and then the rest of the cipher will be easy to break.

Frequency analysis will also almost certainly be possible. For instance, the letter q occurs with frequency 0.1% in English, 0.02% in German, and 0.9% in Spanish. In contrast, the letter e occurs with frequency 14.7%, 17.4%, and 13.7% in English, German, and Spanish, respectively. Therefore, if you choose uniformly at random between English, German, and Spanish, the letter q will occur in the plaintext with frequency about 0.3%, while the letter e will occur with frequency about 15.3%. Notice how e is still much more common than q? This indicates that frequency analysis remains possible. (Wikipedia has data on the frequency statistics of different languages.)

Digraph analysis (the frequency of pairs of letters, like the pair th or qu) will also almost certainly be possible.

Finally, there are more sophisticated methods for cryptanalysis of simple substitution ciphers, such as hill-climbing. These methods will almost certainly be effective at ciphertext-only cryptnanalysis.

And the cipher will completely fall apart in the presence of known plaintext (let alone chosen ciphertext).

TL;DR: Your proposal is highly insecure. Don't use it.

  • $\begingroup$ Quite clever. however could it be possible to avoid thos "unique word" detection by using more than 26 letters? For example mm could become a new letter (all double letter) $\endgroup$ Jul 22, 2013 at 8:30
  • 3
    $\begingroup$ @sliders_alpha: That idea was explored in classical cryptography as well (see polygraphic substitution). Ultimately, it all fell to cryptanalysis. If you're interested in learning more about classical cryptography, I'd recommend The Code Book by Singh and The Codebreakers by Kahn. $\endgroup$
    – Reid
    Jul 22, 2013 at 17:17
  • 1
    $\begingroup$ Averaging the letter frequencies of each combination of three languages should also yield a series of unique profiles. But to actually make use of them will require a large amount of ciphertext written in the same manner as sources from which the frequency tables were generated. It's not impossible, it will just take 364 times more ciphertext than a single language (number of combinations of 3 of 14 languages). $\endgroup$ Nov 17, 2013 at 23:40

All natural languages use some symbols more than they use others (or maybe not? Is there a linguistics expect among us to correct me?).

Therefore, if your cipher doesn't mask the frequency of the characters (eg. a simple permutation or substitution) then you are vulnerable to frequency analysis. Perhaps Chinese is somewhat resistant to this but still vulnerable.

However, since you are using the Latin alphabet for all languages, I don't see how you gain any advantage by mixing them up. The only disadvantage goes to the receiver who (potentially) has to use a dictionary to see what you mean. So can the attacker.

Your system does provide some degree of obfuscation but there are only so many languages using the Latin alphabet. If you use a single language for the entire message, the cipher can easily be broken. If you use a different translation for each word in the message you may complicate things a bit but you don't gain any real advantage.

  • $\begingroup$ I'm using the latin alphabet but not only latin languages. $\endgroup$ Jul 22, 2013 at 8:31
  • $\begingroup$ "I don't see how you gain any advantage by mixing them up" you don't know what language has been use for a particular word. therefor you can't calculate the frequency of apparition. $\endgroup$ Jul 22, 2013 at 12:26
  • $\begingroup$ you can't calculate the frequency of apparition but you can see such a frequency exists. This is an interesting question and an algorithm which cracks the scheme you propose is definitely something I'd like to see. $\endgroup$
    – rath
    Jul 22, 2013 at 13:20

Your Answer

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

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