The first mentions of encoded messages date back to the time of Herodotus, who described in his book, Histories, how a secret message saved Greece from the despotic Persians in the 5th century BC. Demaratus was a general in the Persian army, but was Greek by birth, and remained loyal to his country. He warned the Spartan generals of a surprise attack by the Persians, by sending a message engraved on a wooden tablet and hidden underneath a layer of wax.
The technique of sending secret communications by concealing the message is called steganography, which comes from the Greek word steganos, meaning ‘covered’, and graphein, meaning ‘writing’. It has been used in various formats around the world, from Herodotus to the present day. Steganography provides a certain level of security, but it also has a major weakness: if someone actively tries to decipher the message, and knows which coding technique has been used, it will not take them long to discover its meaning. In other words, if the message is intercepted, its security is immediately compromised.
This is one of the reasons why cryptography, which comes from the Greek word kryptos, meaning ‘hidden’, was developed alongside steganography. The aim of cryptography is not to hide the existence of the message, but to conceal its meaning, in a process known as ‘encryption’. This involves rendering the message unintelligible, by encoding it according to a system that is agreed upon between the sender and the recipient. The advantage of encryption is that the message appears unreadable to anyone who is not familiar with the decryption code, including interceptors or enemies.
Cryptography can be divided into two branches: transposition, where each letter retains its meaning but changes its position in the message, and substitution, where each letter retains its position but changes its meaning. In transposition, the letters of the message are simply mixed together to form an anagram; the more words and phrases there are in the message, the more difficult it is to rearrange the letters to make sense of the words. If the anagram is generated randomly, it is impossible for an interceptor or the recipient to decipher. The transposition of the message must therefore follow a pre-established system, but this is easier for an interceptor or enemy to decode.
In substitution, each letter of the message is replaced by a different letter, according to a pre-established and agreed system. This produces a ‘ciphertext’, which refers to any form of cryptographic substitution in which each letter is replaced by a different letter or symbol. Replacing the 26 letters of the alphabet with 26 other symbols can potentially produce billions of different ciphertexts. Once the two parties agree on the key to the ciphertext, it becomes virtually impossible to decipher the message without the key.