How can I make my own codes?
How safe is my cipher?
In a simple Caesar cypher there are only 25 possible keys, so a decoder can try each possible combination of letters and see if it works. That might sound like a challenge, but even doing it by hand doesn’t take all that long. A computer program could unravel the code in a fraction of a second. So a Caesar cypher isn’t very secure.
That’s because each letter is shifted by the same amount, so there are very few combinations. Suppose you shuffled the letters completely – that would be a much more complex cypher code.
One way to crack ciphers is by using frequency analysis. Remember that some letters appear more often than others? You can use that to help read an encrypted message. The method goes someting like this:
- Count how often each letter appears in the encrypted message.
- The most-used letter probably represents ‘e’, so guess that’s the case in the cypher you’re trying to break.
- Now look for three-letter words which end with the letter representing ‘e’. The most common word is likely to be ’the’… so you have the letters ’t’, ‘h’ and ‘e.’ Fill in all the other places where those letters appear.
- Remember that the most common letters in English are, in order, e, t, a, i, o, s, h, r; you may be able to start working out some other letters…
- …pretty soon, you’ll be able to guess whole words.
Try writing a paragraph with your cipher and then getting your friends to crack it using frequency analysis. It takes time, but it’s very satisfying
If you and your friends use your cipher regularly to pass on secret messages, there is the risk is that someone will discover your key. You can help prevent this by changing the key regularly, to keep your secrets safe.