# Anyone here know anything about 19th century commercial ciphers for telegrams?

**URL:** <https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784>\
**Category:** Factual Questions\
**Created:** [December 12, 2019, 10:18pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784 "2019-12-12T22:18:12Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [December 13, 2019, 11:00pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/21 "2019-12-13T23:00:09Z")

</div>

> [@beowulff](#):
>
> [Bolding mine]  
> How? This is just a one-time pad, which is theoretically unbreakable, if proper protocol is followed.

It’s not a one-time pad, it’s a keyed cipher. The key is the book. And even if you consider the keyspace as the set of all books ever published (a hundred million or so), that’s a very small keyspace compared to modern ciphers. With Google Books now available, it’s probably relatively straightforward to break a book cipher with a brute force attack, given enough ciphertext and enough motivation.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [December 13, 2019, 11:05pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/22 "2019-12-13T23:05:15Z")

</div>

> [@markn\_1](#):
>
> It’s not a one-time pad, it’s a keyed cipher. The key is the book. And even if you consider the keyspace as the set of all books ever published (a hundred million or so), that’s a very small keyspace compared to modern ciphers. With Google Books now available, it’s probably relatively straightforward to break a book cipher with a brute force attack, given enough ciphertext and enough motivation.

Yeah, I’ll do that with my telegraph connected to the internet…

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [December 13, 2019, 11:12pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/23 "2019-12-13T23:12:26Z")

</div>

> [@GreenWyvern](#):
>
> Another point about encrypted telegraph messages was that they had to be sent and received by ordinary telegraph clerks.
> 
> If the message was only a meaningless string of letters and numbers, there would be far more chance of mistakes. By sending actual words, the chance of errors was reduced. And if one letter of a word was wrong, you could probably guess what it was supposed to be.

Yeah this kind of thing happened - see this law case [Primrose v. Western Union Tel. Co. :: 154 U.S. 1 (1894) :: Justia US Supreme Court Center](https://supreme.justia.com/cases/federal/us/154/1/) in which this coded message:

“Despot am exceedingly busy bay all kinds quo perhaps bracken half of it mince moment promptly of purchase.”

was received as

“Destroy am exceedingly busy buy all kinds quo perhaps bracken half of it mince moment promptly of purchases.” - leading to great financial loss.

---

<div class="post-metadata">

**Author:** ![leahcim](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leahcim](https://boards.straightdope.com/u/leahcim)\
**Post date:** [December 13, 2019, 11:22pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/24 "2019-12-13T23:22:36Z")

</div>

> [@beowulff](#):
>
> Yeah, I’ll do that with my telegraph connected to the internet…

If you restrict to “books that have a wide enough publication in the time of the telegraph that two people at opposite ends of a telegraph line can reasonably both get the exact same edition” the pool of possible books drops substantially, possibly within the realm of being possible to be checked by a suitably motivated police force.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [December 13, 2019, 11:34pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/25 "2019-12-13T23:34:29Z")

</div>

> [@leahcim](#):
>
> If you restrict to “books that have a wide enough publication in the time of the telegraph that two people at opposite ends of a telegraph line can reasonably both get the exact same edition” the pool of possible books drops substantially, possibly within the realm of being possible to be checked by a suitably motivated police force.

Do the math…

---

<div class="post-metadata">

**Author:** ![Schnitte](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/schnitte/32/9033_2.png) [@Schnitte](https://boards.straightdope.com/u/Schnitte)\
**Post date:** [December 14, 2019, 12:21pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/26 "2019-12-14T12:21:56Z")

</div>

To throw in a little background on the type of complications this could lead to, there is the interesting court case of [Primrose v. Western Union](https://caselaw.findlaw.com/us-supreme-court/154/1.html), decided by the Supreme Court in 1894. Mr. Primrose was a Philadelphia-based merchant involved in the wool trade. One day in 1887, he sent a telegram (which cost $1.15 to deliver) via Western Union to his agent in Kansas, which read as follows: “Despot am exceedingly busy bay all kinds quo perhaps bracken half of it mince moment promptly of purchases.” By the code book they were using, this text would have been a confirmation of a message earlier received from the agent and some information about the wool business; but it was transmitted with several errors, most notably a substitution of “bay”, which by that code book meant “I bought”, to “buy” (remember that in Morse code, an A is one dot followed by a dash, while a U is two dots with a dash, so they are very similar). With these errors, the recipient agent understood the message as an instruction to buy 500,000 pounds of wool. He went on to follow this instruction and ended up buying 300,000 pounds of wool, which caused Mr. Primrose a loss of $20,000. He sued Western Union for this amount, but all he got was a refund of the $1.15 that he had paid for the telegram. A key factor in the reasoning of the courts was that Western Union offered the option of repeating delivered messages back to the sender for comparison, and also offered an optional insurance against transmission errors, but Mr. Primrose had declined both.

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [December 14, 2019, 12:26pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/27 "2019-12-14T12:26:23Z")

</div>

> [@Schnitte](#):
>
> To throw in a little background on the type of complications this could lead to, there is the interesting court case of [Primrose v. Western Union](https://caselaw.findlaw.com/us-supreme-court/154/1.html), decided by the Supreme Court in 1894. Mr. Primrose was a Philadelphia-based merchant involved in the wool trade. One day in 1887, he sent a telegram (which cost $1.15 to deliver) via Western Union to his agent in Kansas, which read as follows: “Despot am exceedingly busy bay all kinds quo perhaps bracken half of it mince moment promptly of purchases.” By the code book they were using, this text would have been a confirmation of a message earlier received from the agent and some information about the wool business; but it was transmitted with several errors, most notably a substitution of “bay”, which by that code book meant “I bought”, to “buy” (remember that in Morse code, an A is one dot followed by a dash, while a U is two dots with a dash, so they are very similar). With these errors, the recipient agent understood the message as an instruction to buy 500,000 pounds of wool. He went on to follow this instruction and ended up buying 300,000 pounds of wool, which caused Mr. Primrose a loss of $20,000. He sued Western Union for this amount, but all he got was a refund of the $1.15 that he had paid for the telegram. A key factor in the reasoning of the courts was that Western Union offered the option of repeating delivered messages back to the sender for comparison, and also offered an optional insurance against transmission errors, but Mr. Primrose had declined both.

See #23 ([https://boards.straightdope.com/sdmb/showpost.php?p=22026031&postcount=23](https://boards.straightdope.com/sdmb/showpost.php?p=22026031&postcount=23))

---

<div class="post-metadata">

**Author:** ![DesertDog](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/desertdog/32/11503_2.png) [@DesertDog](https://boards.straightdope.com/u/DesertDog)\
**Post date:** [December 14, 2019, 4:00pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/28 "2019-12-14T16:00:15Z")

</div>

> [@bob\_2](#):
>
> It should be, but so was Enigma; the weak link, as always is the human factor.

The biggest flaw in Enigma was that a letter could never be encrypted to itself. If you’ve seen films of those whirling bombes in Bletchley Park or _The Imitation Game_, what they’re doing is taking a crib – a known piece of clear text – and checking to see if any of it’s letters are duplicated in the cypher text. Example:

_Wetterbericht_ (Weather report) is checked for in the cypher text the part where it it’s expected it would appear. If any letter appears in the cypher text where it appears in in the clear text (W at the beginning, for example), that rotor setting cannot be right, and the machine moves on to the next one.

When a setting with no matches is found, that _might_ be the setting used, and it is sent off to where an Enigma copy is used to decypher the whole message and see if anything pops up.

Where the human error would come in is a lazy clerk only changing a rotor or two only a couple of notches for the next part of a long message instead of a random change of all three (or four) as was supposed to be done. An even bigger factor was when a hardware change was made, inevitably someone would ask, “We don’t have the new equipment yet. Can you resend the message the old way?” The code breakers would thus have the complete encrypted text in both the old (that they could break) and the new (which they couldn’t, yet) way greatly expediting figuring out what the new equipment entailed.

It still took a couple months to do so. If you’ve read a history about the Atlantic war mentioning what the Germans called Happy Time where the submarines were more successful for a while, its when the KM changed their Enigmas and Bletchley Park couldn’t break the code for a while.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 14, 2019, 4:14pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/29 "2019-12-14T16:14:42Z")

</div>

> [@Andy\_L](#):
>
> See #23 ([https://boards.straightdope.com/sdmb/showpost.php?p=22026031&postcount=23](https://boards.straightdope.com/sdmb/showpost.php?p=22026031&postcount=23))

Yes, you posted it. **Schnitte** explained it.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 14, 2019, 4:19pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/30 "2019-12-14T16:19:21Z")

</div>

> [@davidm](#):
>
> Can you post the text here?

‘Fraid not, sorry. Reasons.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 14, 2019, 4:28pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/31 "2019-12-14T16:28:42Z")

</div>

> [@leahcim](#):
>
> If you restrict to “books that have a wide enough publication in the time of the telegraph that two people at opposite ends of a telegraph line can reasonably both get the exact same edition” the pool of possible books drops substantially, possibly within the realm of being possible to be checked by a suitably motivated police force.

But you still need the key number. The books with corresponding numbers were publicly available, as **Bibliophage** noted. Without the key number and no computers, I doubt that your average 19 th century police force or commercial competitor could crack the cipher, especially if the sender changed the key for each message.

Plus, this was the equivalent of “Pretty good privacy” - most commercial telegrams would only have needed to be kept secret for a limited time, until the recipient bought the ton of kumquats, or the merger went through, and so on. Even if the message could b cracked, pre-computer, the information gained would likely be stale and of no value.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [December 14, 2019, 8:18pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/32 "2019-12-14T20:18:45Z")

</div>

I think leachim was responding to the subthread discussing the book cipher that bob++ described in #11, which doesn’t use a key. The security resides in the secrecy of which book is used.

Northern Piper, how big are the key numbers in your telegraphic code? If they’re small then obviously an exhaustive search might be possible.

Another thing that occurs to me is the scheme as you describe it would work only if the codebook assigns a meaning to EVERY number in the book’s range. If there are gaps in the numbering, then adding a number to a valid code number might result in an invalid code number.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 14, 2019, 8:55pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/33 "2019-12-14T20:55:05Z")

</div>

They’re all five digits, in the sample I have.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [December 14, 2019, 9:35pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/34 "2019-12-14T21:35:56Z")

</div>

I guess this technique wouldn’t have been used to encrypt anything terribly important then. I suppose it wouldn’t take more than a couple of minutes to check one key against a message to see if the decryption makes sense. If it were worth it to someone to hire 100 people to work on it, they could decrypt a message in a day or two.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [December 14, 2019, 11:45pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/35 "2019-12-14T23:45:18Z")

</div>

> [@Northern\_Piper](#):
>
> They’re all five digits, in the sample I have.

If they are all 5 digit numbers, then perhaps they aren’t encrypted at all. They may be just index numbers for the code book.

Code books sometimes provided 5 digit index numbers as well as or instead of code words.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 15, 2019, 4:43am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/36 "2019-12-15T04:43:52Z")

</div>

Except the person enciphering it added 300 to each number, then wrote out a new word beside the sum. If the number was just a reference to a code word, why do that?

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [December 15, 2019, 5:11pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/37 "2019-12-15T17:11:06Z")

</div>

> [@Northern\_Piper](#):
>
> Yes, you posted it. **Schnitte** explained it.

Point taken.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [December 15, 2019, 10:36pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/38 "2019-12-15T22:36:32Z")

</div>

> [@Northern\_Piper](#):
>
> Except the person enciphering it added 300 to each number, then wrote out a new word beside the sum. If the number was just a reference to a code word, why do that?

Ah. Ok. Just went back and re-read your posts.

Several of the most popular code books are available online. If you don’t already know, you may be able to work out which book was used.

---

<div class="post-metadata">

**Author:** ![Ignotus](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Ignotus](https://boards.straightdope.com/u/Ignotus)\
**Post date:** [December 16, 2019, 2:54am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/39 "2019-12-16T02:54:54Z")

</div>

> [@Senegoid](#):
>
> This encryption algorithm was exactly at the center of a Sherlock Holmes story. (Sorry, don’t remember which. Someone here will surely fill in the blanks.) Needless to say, Holmes quickly guessed what the magic book was (although, to be sure, it took him two tries.)

I don’t see this answered, so I’ll fill in: it’s in _The Valley of Fear_. The same novel also hints at another(?) cipher system, used by the novel’s main protagonist (not Sherlock!), while working undercover some decade or more earlier in the coal-mining districts in the US. Alas, the story gives no details.

---

<div class="post-metadata">

**Author:** ![Northern\_Piper](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/northern_piper/32/5304_2.png) [@Northern\_Piper](https://boards.straightdope.com/u/Northern_Piper)\
**Post date:** [December 16, 2019, 4:19am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/40 "2019-12-16T04:19:16Z")

</div>

> [@Ignotus](#):
>
> I don’t see this answered, so I’ll fill in: it’s in _The Valley of Fear_. The same novel also hints at another(?) cipher system, used by the novel’s main protagonist (not Sherlock!), while working undercover some decade or more earlier in the coal-mining districts in the US. Alas, the story gives no details.

I always thought that one was the worst of the four novels.

[Previous page](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784.md?page=1)

[Next page](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784.md?page=3)
