The historian Herodotus, writing around 440 BC, preserved two of the oldest secret-message tricks we know of. One was Histiaeus's tattooed courier, sent to spark the Ionian Revolt against Persia. The other was the exiled Spartan king Demaratus, who warned Greece of Xerxes' coming invasion by scraping the wax off a writing tablet, scratching his message into the bare wood, and re-coating it — a blank tablet that anyone could inspect and no one would suspect. This is steganography, from the Greek for "covered writing": you don't scramble the message, you hide that a message exists at all.
Steganography has one fatal weakness — discovery is total defeat. Find the hidden ink, the buried wood, the scalp beneath the hair, and the secret is simply gone. So a second, deeper strategy grew up beside it: cryptography, scrambling the meaning so that even a message found in plain view stays unreadable. The Spartans wound a strip of leather around a rod of fixed diameter — a scytale — so the letters only lined up on a matching rod. Centuries later Julius Caesar simply shifted every letter three places down the alphabet. Crude as they were, these were the first moves in a contest that has never stopped: the maker of secrets against the breaker of them.