Substitution Cipher encoder and decoder

A simple pair of functions to encode messages and decode them by means of frequency analysis.
1,7K téléchargements
Mise à jour 22 mai 2011

Afficher la licence

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.

Citation pour cette source

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

Compatibilité avec les versions de MATLAB
Créé avec R2010a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Encryption / Cryptography dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0