Tool to decrypt / encrypt by homophonic substitution, the homophonic cipher consists of replacing each letter of the alphabet by several substitutes in order to prevent cryptanalysis by frequency analysis.
Homophonic Cipher - dCode
Tag(s) : Homophonic Substitution Cipher
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The homophonic cipher is a substitution cipher that uses a correspondence table between the letters / characters of the plain message and one or more letters / numbers / groups of characters.
Consequently, the same letter may have several possible encryption and the same message will possibly have several possible encrypted versions.
The homophonic cipher helps hide the frequency of letters used in a message, thus making frequency analysis more difficult for a cryptanalyst.
To use the homophonic cipher, the user must first define a correspondence table between the plain text characters and one or more symbols for each character.
During the encryption process, randomly choose from these symbols each time a specific character needs to be encoded. This ensures that the same character is not always represented by the same symbol in the ciphertext.
Example: Using the nomenclature A(45,96,17), B(37,60), C(05,88), it is possible to code ABC as 45,60,88 or 96,60,05 or 96,37,05 etc.
To maximize encryption security, it is smart to use a number of matches per letter proportional to the frequency of the letter in the language of the clear message, and be sure to select a replacement from the list randomly.
Use the correspondence table to transform each character / group of characters in the plain message.
Example: 34,25,10 has been coded with these multiple correspondences: A(87,34,11), B(25,80), C(10,55), the plain message is ABC
By taking 100 numbers, the ideal match is approximately equal to the frequency of each letter in the English language (expressed as a percentage rounded to the nearest unit)
E | 12 | T | 9 | A | 8 | O | 7 |
---|---|---|---|---|---|---|---|
I | 7 | N | 7 | S | 6 | H | 6 |
R | 6 | L | 4 | D | 4 | C | 2 |
U | 2 | M | 2 | W | 2 | F | 2 |
G | 2 | Y | 2 | P | 2 | B | 2 |
V | 1 | K | 1 | J | 1 | X | 1 |
Q | 1 | Z | 1 |
Using 50 numbers, roughly divide the quantities by 2.
Using the pieces of a Scrabble game is a good idea.
When well done, the frequency of characters in a homophonically encrypted message is close to that of a perfectly random text, its index of coincidence too.
In order to simplify the work of the receiver of the message, it is common to use groups of numbers/letters of fixed length (2 or 3 digits).
If the correspondence table is accessible, the figure becomes a classic substitution system.
Using a homophonic cipher makes the ciphertext more resistant to frequency analysis methods.
In cryptography, hiding the frequency of letters in text helps protect against decryption attempts that exploit this information.
If the correspondences are proportional to the frequency of characters in the language of the plain message, then it is impossible to use frequency analysis or coincidence index techniques.
From a portion of known or assumed text, it is possible to guess a few correspondences of some characters but it is often insufficient to decipher the whole message.
dCode retains ownership of the "Homophonic Cipher" source code. Except explicit open source licence (indicated Creative Commons / free), the "Homophonic Cipher" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Homophonic Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Homophonic Cipher" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Homophonic Cipher" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Homophonic Cipher on dCode.fr [online website], retrieved on 2024-11-21,