Substitution Cipher encoder and decoder

A simple pair of functions to encode messages and decode them by means of frequency analysis.
1,7K download
Aggiornato 22 mag 2011

Visualizza la licenza

This function uses frequency analysis to attack and decode messages
encoded using a /substitution cipher/ which exchanges each letter of the
alphabet for another. Unlike the famous "Caesar Shift" cipher, which
"shifts" the letters of the alphabet along by a certain amount, giving
just 26 possible ciphers, this has no specific order, giving 26!
possibilities. The function is very unlikely to work first time but,
depending of the length of the text, highly likely to get the letters "T"
and "E" correct. From here the user may spot an error in the decoding,
such as "TQE" which is obviously "THE", and the function offers them the
chance to swap the offending letters as often as is required. After a few
simple cases, the encrypted message is generally broken.
It removes all punctuation and case from the original
text. The other m-file can be used to encode messages in the substitution cipher, using a random arrangement of letters and giving the user the cipher key as well as encoded message.

Cita come

Dafydd Stephenson (2025). Substitution Cipher encoder and decoder (https://it.mathworks.com/matlabcentral/fileexchange/31522-substitution-cipher-encoder-and-decoder), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2010a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Encryption / Cryptography in Help Center e MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0