Simple codes
Any way to write a message by hand that would be hard for someone else to read falls into this category. This includes writing things in a different alphabet. Iāve played with Icelandic runes and the International Phonetic Alphabet (IPA), as well as more niche created alphabets like the Deseret Alphabet (which was extremely tedious to write a message in).
Substitution ciphers
In this kind of code, each letter is equivalent to another. If I had a five-letter alphabet (a, b, c, d, e), I might say: a => c, b => e, c => b, d => d, e => a A message is then encoded by replacing each letter with its value (a becomes c, etc.). Decoding the message just requires reversing the key (c becomes a, etc.). This kind of code is extremely easy to crack. It can be solved with time by hand like a puzzle, starting with guessing letters for shorter words. It is extremely easy to solve with a computer, using frequency analysis of different letters. In each language, some letters are more common than others. For example, in English, āeā is far more common than any other letter, so if the message is long enough to have many reused characters, whichever letter is used with the greatest frequency can probably be replaced with āe.ā There are many variations on this kind of cipher or ways that people try to make it more difficult to crack. A couple versions are the Caesar Cipher and ROT13. Morse code is also an example of a substitution cipher, but instead of replacing letters with other letters, letters are replaced with sequences of long and short beeps. A substitution cipher could also use another language's alphabet, but that may be a little more complicated than replacing one letter with another since thereās not always a 1:1 transfer of letters and sounds between languages.Book ciphers
Another cryptography technique relies on both the writer and the recipient having exact copies of a book or some other written material. The person writing the message can indicate the page, line, and number of the character in the line they are referencing for each letter in their message. So a single letter may look like 35:7:18. If a codebreaker does not know which book was used, this code can be hard to crack, because there may be no repetition in the coded message at all (the first time I code the letter āe,ā I may take it from a different place in the book than the second time). The movie National Treasure has an example of this kind of code. The main characters find a code made of numbers and figure out that the numbers point to words in the Silence Dogood letters. Knowing that their enemies are watching the text, they pay a boy to go count through the words in the documents and find the clue they need. If someone can guess or find out what book or written source is being used for encoding, then this code is cracked.Steganography or hidden messages
Another method used to transfer information secretly is steganography. A message canāt be decoded if it canāt be found. Using invisible ink or putting the message in an unexpected place, like hidden in a painting, are examples of steganography. National Treasure also has a good example of steganography. A message hidden in invisible ink on the back of the Declaration of Independence gives the characters clues about where to go. To crack hidden messages, they first need to be found. They can be hidden in obvious or very unexpected places, and the hidden message can also be encoded in other ways, making it more difficult to decipher even if it is found.Modern encryption
The Code Book by Simon Singh shows how codes have evolved over time, and it is a great read if you are interested in finding out how we went from simple ciphers to the more complex encryption methods we use today. Here are a few modern cryptography techniques.A different base
A relatively simple way to encode a message, although one that can be extremely tedious to perform by hand, involves using a different base. While we are used to the base-10 number system, programmers are generally familiar with binary (base-2), hexadecimal, commonly referred to as hex (base-16), and other systems as well. Once the basic concept behind different bases is understood, it can be easily applied to any base. To convert letters to a different base, you can use the lettersā ASCII values or create your own method for linking your alphabet to numbers. Then itās a question of converting a number from one base to another. If youāre not familiar with that process, hereās an example of turning a decimal number into binary and into hex. 100 is a nice round number in a base-10 system, so weāll use that. In binary, 1 is 1, 10 is 2, 11 is 3, 100 is 4 and so on. So if you wanted to do this conversion just in your head, you could see that 1000 is 8, 10000 is 16, 100000 is 32, and 1000000 is 64 (all powers of 2). So:

Symmetric encryption
Symmetric encryption is when both the sender and the receiver of a message have the same key, which is used both to encrypt and decrypt a message. Substitution ciphers (like the ones mentioned above) are technically symmetric encryption, but modern symmetric encryption can be much more complicated. A stream of symbols at least as long as the message that is being encrypted can be used to encode and decode the message. Here is a very simple example, where the key is made of numbers that are added to the ASCII symbols to encode and then subtracted to decode. I used single-digit numbers for the key for simplicity.| Message | H | e | l | l | o | , | w | o | r | l | d | ! | |
| ASCII Values | 72 | 101 | 108 | 108 | 111 | 44 | 32 | 119 | 111 | 114 | 108 | 100 | 33 |
| Key | 1 | 4 | 7 | 4 | 8 | 9 | 2 | 3 | 1 | 4 | -4 | -6 | 9 |
| Key Added to ASCII Values | 73 | 105 | 115 | 112 | 119 | 53 | 34 | 122 | 112 | 118 | 104 | 94 | 42 |
| ASCII Symbols of Encoded Message | l | i | s | p | w | 5 | " | z | p | v | h | ^ | * |
