4000 years before ...
The first writings appeared in Egypt and were carved into the living rock in the main chamber of the tomb of Khnumhotep II. The writer used unusual hieroglyphic symbols instead of the more ordinary ones. This type of ancient inscription was not really true cryptography to ensure secrecy but typifies just an important aspect of cryptography: the deliberate transformation of the writing. It also was the era of funerary cryptography to increase mystery among religious rites and to impress the reader. Although first steps towards secrecy were taken, cryptography was seen as a kind of puzzle or game and was meant to delay comprehension for only the shortest possible time, not the longest.
In the course of time the secure transmission of messages became more important, mainly concerning communication in military affairs. Messengers were sent out to deliver any kind of information to the own troops and even if they were caught by the enemy the message must not be found. So the first thought was, to hide the message in a clever way, which is called steganography. In ancient Greece, people wrote messages on wooden tablets and then covered it with wax, so that it looked like an unused tablet. According to Herodotus, who lived in the 5th century BCE, a message was sometimes tattooed on a slave's shaved head, which was covered by hair regrowth and exposed by reshaving. There are also stories about messengers who hid a wax ball containing the secret message by simply swallowing it.