The story of Bellerephon, as told by Homer in Book VI of the Iliad, may be of interest:
There is a city in the heart of Argos, pasture land of horses, called Ephyra, where Sisyphus lived, who was the craftiest of all mankind. He was the son of Aeolus, and had a son named Glaucus, who was father to Bellerophon, whom heaven endowed with the most surpassing comeliness and beauty. But Proetus devised his ruin, and being stronger than he, drove him from the land of the Argives, over which Jove had made him ruler. For Antea, wife of Proetus, lusted after him, and would have had him lie with her in secret; but Bellerophon was an honourable man and would not, so she told lies about him to Proteus. 'Proetus,' said she, 'kill Bellerophon or die, for he would have had converse with me against my will.' The king was angered, but shrank from killing Bellerophon, so he sent him to Lycia with lying letters of introduction, written on a folded tablet, and containing much ill against the bearer. He bade Bellerophon show these letters to his father-in-law, to the end that he might thus perish; Bellerophon therefore went to Lycia, and the gods convoyed him safely.
"When he reached the river Xanthus, which is in Lycia, the king received him with all goodwill, feasted him nine days, and killed nine heifers in his honour, but when rosy-fingered morning appeared upon the tenth day, he questioned him and desired to see the letter from his son-in-law Proetus. When he had received the wicked letter he first commanded Bellerophon to kill that savage monster, the Chimaera, who was not a human being, but a goddess, for she had the head of a lion and the tail of a serpent, while her body was that of a goat, and she breathed forth flames of fire; but Bellerophon slew her, for he was guided by signs from heaven. He next fought the far-famed Solymi, and this, he said, was the hardest of all his battles. Thirdly, he killed the Amazons, women who were the peers of men, and as he was returning thence the king devised yet another plan for his destruction; he picked the bravest warriors in all Lycia, and placed them in ambuscade, but not a man ever came back, for Bellerophon killed every one of them. Then the king knew that he must be the valiant offspring of a god, so he kept him in Lycia, gave him his daughter in marriage, and made him of equal honour in the kingdom with himself; and the Lycians gave him a piece of land, the best in all the country, fair with vineyards and tilled fields, to have and to hold.
The Iliad, by Homer. Translated by Samuel Butler.
It could be argued that the "wicked letter" was simply sealed and not encoded. However, Homer uses "σήματα λυγρά"1 to describe it, a phrase that points to pictorial tokens and perhaps allows us to interpret the letter as an encrypted one.
Interestingly, this story is the only mention of writing in the Iliad, and the source of the phrase "bellerophonic letter".
1 see http://www.perseus.tufts.edu/hopper/morph?l=sh%2Fmata&la=greek&can=sh%2Fmata0&prior=ge#lexicon