In The Adventure of the Dancing Men, a simple substitution cipher is used between a woman and her former lover. The total corpus written in this cipher was slight, consisting of a handful of very short and elliptical exchanges, a dozen words in total, such that in real life someone hoping to decrypt them might need a lucky break.
Doyle let me down a bit, here. Although Holmes is known for his happy insights and for following hunches, I found the account of his decryption of this cipher to be somewhat unconvincing.
He starts by assuming that the most common letter is E, which is fair enough: in such a short body of work it might _not_ be but it is a reasonable place to start.
He then gets to:
“Now in a single word I have already got the two E’s coming second and fourth in a word of five letters. It might be ‘sever’ or ‘lever’ or ‘never’. There can be no question that the latter as a reply to an appeal is far the most probable, and the circumstances pointed to its being a reply written by the lady.”
Well, yes it might be ‘sever’, ‘lever’, or ‘never’. It might also be ‘Helen’ or ‘Peter’ or ‘rebel’ or ‘renew’ or ‘seven’ or ‘jewel’ or ‘leper’ or ‘semen’ or ‘fever’ or any of hundreds of words. English isn’t short on five letter words with the 2nd and 4th letters being E.
Also: the latter of three? Tut tut.