# 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:** 1

<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 12, 2019, 10:18pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/1 "2019-12-12T22:18:12Z")

</div>

I’ve been doing a bit of historical research for a project, and I came across a commercial telegram that appears to have been encoded for secrecy.

I’ve got the draft of the text, and then the worksheet to turn it into a cipher to be sent by telegram. Each word from the text is assigned a number, then a number is added to that number, which apparently gave a new word, which is what would be sent by telegram, apparently a nonsense string of words.

I assume it was common to use ciphers when you had to give the text of your message to the telegram company. Anyone there could read it in clear, so you put it in a cipher, with the recipient at the other end knowing how to decrypt it.

Anyone have any experience with this sort of thing? I assume there were thick code books, which assigned words to numbers. If the recipient knew which code book, and the number you add, they could decipher it at the other end.

---

<div class="post-metadata">

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

</div>

There were a vast number of cyphers going back to the Sumerians and the Egyptians. In the 1850s the Vigenère cypher gained a reputation for being exceptionally strong, but Babbage found a way to break it in the 1850s.

[Here](https://www.theguardian.com/technology/2015/jul/15/first-hack-telegraph-invention-privacy-gchq-nsa) is an interesting article on the subject of encoded telegraphs.

---

<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 13, 2019, 12:28am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/3 "2019-12-13T00:28:53Z")

</div>

It’s not Vigenère - too complex.

From the paper I found, it looks like the person composing the cipher wrote out the first word of his text, say “Shipment”. Then beside it he wrote a five digit string. Something like 22691. Then he added a number to it, say 100. So now the number is 23691. Then he wrote a completely different word, unrelated to shipment, let’s say “bellows”

So what I think happened is that he had a commercial cipher book, with thousands of words, each assigned a unique number. He looks up “Shipment” and finds it is assigned 22691. He decides what number he’ll add, choosing 100, then looks up 23691, finds that it’s the number for “bellows” and writes out “bellows” as the first word of the cipher.

He then goes through his message, getting the number for each subsequent word, adding 100, and then looking up the corresponding word. That string of nonsense words is sent by telegram.

The recipient has the same cipher book. He and the sender have agreed in advance that the cipher key number will be 100. So he looks up “bellows” in the cipher book and finds that its number is 23691. He subtracts 100, getting 22691. Then he looks up 23691 and finds that it’s the number for “shipment” and that’s the first word of the message. Then he does the same process for each subsequent word.

Does that sound right?

---

<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 13, 2019, 12:34am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/4 "2019-12-13T00:34:24Z")

</div>

Note that this was isn’t a code word system, where certain words have an agreed upon expanded meaning. Those telegram codes were designed to compress data, saving money (telegram companies charged by the word), but were publicly available and didn’t conceal the meaning of the message.

---

<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 13, 2019, 12:43am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/5 "2019-12-13T00:43:03Z")

</div>

In post 3 I meant that Vingenère is too complex to be this cipher.

---

<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 13, 2019, 12:47am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/6 "2019-12-13T00:47:47Z")

</div>

I wish **Captain Ridley’s Shooting Party** still posted here. ☹

---

<div class="post-metadata">

**Author:** ![bibliophage](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bibliophage/32/7615_2.png) [@bibliophage](https://boards.straightdope.com/u/bibliophage)\
**Post date:** [December 13, 2019, 1:29am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/7 "2019-12-13T01:29:59Z")

</div>

I recall reading about them in a book on cryptography, possibly _The Code Book_ by Simon Singh. You have the right idea about how they worked. Frank Miller invented the most secure system, known as [the one-time pad](https://en.wikipedia.org/wiki/One-time_pad). If used properly and if the pre-shared key of shift numbers is kept secret, it can’t be broken.

Each correspondent would buy a commercially available book listing the codes and their meanings, such as [this one](https://books.google.com/books?id=tT9WAAAAYAAJ&newbks=1&newbks_redir=0&dq=telegraph%20secrecy%20code%20book&pg=PA4#v=onepage&q=truly&f=false) by Miller himself. They would share (usually by postal mail) a list of the (preferably randomly generated) shift numbers they intend to use in composing their future telegraphic messages. When he wants to send a secret message, the sender uses the first shift number from his list that he hasn’t used yet. He looks in the book for the word or phrase he wants to relay, notes the corresponding number, adds the shift number to it and writes the word corresponding to that number. To decode it, the receiver looks on the list of the shift numbers his correspondent earlier sent him, and finds the first shift number that hasn’t been used yet. He looks for the encoded word in the book, finds the associated number, subtracts the shift number, and finds the word or phrase corresponding to that number. The numbers roll over, so if the receiver gets, say, code 15,345 with a book that contains only 14,000 words, it’s really 1345 ( = 15345 - 14000).

For maximum security, you have to use a different shift number for each word of a message, but that requires sharing huge lists of the shift numbers you intend to use. In practice people often used the same shift number for all the words of the message, changing the shift number only when there was a new telegram to send. Some people even used to the same pre-agreed shift number for all their telegrams, which is not very secure at all.

---

<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 13, 2019, 5:51am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/8 "2019-12-13T05:51:32Z")

</div>

Thanks for the book recommendation, **bibliophage**! Will look it up.

---

<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 13, 2019, 8:55am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/9 "2019-12-13T08:55:48Z")

</div>

> [@Northern\_Piper](#):
>
> Note that this was isn’t a code word system, where certain words have an agreed upon expanded meaning. Those telegram codes were designed to compress data, saving money (telegram companies charged by the word), but were publicly available and didn’t conceal the meaning of the message.

Note that many, or perhaps most (or all?), of the commercial code books also included instructions for encryption. Encrypted telegrams cost significantly more to send, but prior compression using the code books made them significantly shorter (and cheaper).

At least at the beginning, manual encryption was very slow and laborious: the encryption methods were simple and often simplistic.

---

<div class="post-metadata">

**Author:** ![GreenWyvern](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/greenwyvern/32/2834_2.png) [@GreenWyvern](https://boards.straightdope.com/u/GreenWyvern)\
**Post date:** [December 13, 2019, 9:28am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/10 "2019-12-13T09:28:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bob\_2](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bob_2/32/3341_2.png) [@bob\_2](https://boards.straightdope.com/u/bob_2)\
**Post date:** [December 13, 2019, 10:13am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/11 "2019-12-13T10:13:24Z")

</div>

A simple code that anyone can use is to have a published book agreed between sender and recipient. Any book will do and in any language so long as both parties use the same version/edition.

At its simplest, all you have to do is to find the word you want to send and send a number which points the recipient to that word. Since no one else knows which book you are using, it is superficially secure, but open to decription by analysis. It’s not hard to imagine putting other staps into the encryption that will make it much harder, although it would never be totally secure.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [December 13, 2019, 10:42am UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/12 "2019-12-13T10:42:27Z")

</div>

> [@bob\_2](#):
>
> A simple code that anyone can use is to have a published book agreed between sender and recipient. Any book will do and in any language so long as both parties use the same version/edition.
> 
> At its simplest, all you have to do is to find the word you want to send and send a number which points the recipient to that word. Since no one else knows which book you are using, it is superficially secure, but open to decription by analysis. It’s not hard to imagine putting other staps into the encryption that will make it much harder, although it would never be totally secure.

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.)

---

<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 13, 2019, 2:25pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/13 "2019-12-13T14:25:28Z")

</div>

He also solved the cipher of the Dancing Men.

---

<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, 3:08pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/14 "2019-12-13T15:08:11Z")

</div>

> [@bob\_2](#):
>
> A simple code that anyone can use is to have a published book agreed between sender and recipient. Any book will do and in any language so long as both parties use the same version/edition.
> 
> At its simplest, all you have to do is to find the word you want to send and send a number which points the recipient to that word. Since no one else knows which book you are using, it is superficially secure, but **open to decription by analysis.** It’s not hard to imagine putting other staps into the encryption that will make it much harder, although it would never be totally secure.

[Bolding mine]  
How? This is just a one-time pad, which is theoretically unbreakable, if proper protocol is followed.

---

<div class="post-metadata">

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

</div>

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

Different books have different words depending on subject, if you have enough words you could guess the book.

---

<div class="post-metadata">

**Author:** ![Manlob](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Manlob](https://boards.straightdope.com/u/Manlob)\
**Post date:** [December 13, 2019, 6:19pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/16 "2019-12-13T18:19:44Z")

</div>

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

It is theoretically unbreakable if the pad is kept secret. Using a published book is not a secret pad, even though the code breaker would have to figure out what book it is.

---

<div class="post-metadata">

**Author:** ![Kevbo](https://avatars.discourse-cdn.com/v4/letter/k/e47774/32.png) [@Kevbo](https://boards.straightdope.com/u/Kevbo)\
**Post date:** [December 13, 2019, 6:33pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/17 "2019-12-13T18:33:53Z")

</div>

> [@Melbourne](#):
>
> Encrypted telegrams cost significantly more to send, but prior compression using the code books made them significantly shorter (and cheaper).

I will add a little bit of detail on why peculiarities of Morse Code caused telegraph companies to charge a premium for encrypted traffic:

Numeric data is much less compact in Morse code. Letters are encoded in as few as one symbol for the most common English letters (E & T) up to four symbols for the least common (like Y, Z, Q) You can send two dits in the space of one dah, so there was a tradeoff between fewer symbols and more dits. with bias toward more dits in the more common letters, and more dahs the less common.

Numerals all encode as 5 symbols, and punctuation marks as 6 symbols. In some cases, where the data was all numeric, the telegraphers might agree to use “cut numbers” , many of which are the same as letters. For example a full numeral two would be …— but a cut two would be …- which is also the letter U.

Also for plain english text, telegraphers might use some standard abbreviations, like ES for AND. Due to per-word charges, there wasn’t much need to abbreviate some other common words like THE, because the sending party would tend omit it from the original message.

Thus not only was it easier for a receiving telegrapher to fill in any blanks with sensible English text, and knowing that a U always follows a Q and other common combinations, it also was MUCH faster to send. Random letters don’t follow the normal English distributions, rules, or conventions, so cypher text made up of 5 letter groups (which became the standard for encrypted traffic) are generally slower to transmit and much harder to accurately receive than English words.

---

<div class="post-metadata">

**Author:** ![davidm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/davidm/32/225_2.png) [@davidm](https://boards.straightdope.com/u/davidm)\
**Post date:** [December 13, 2019, 6:51pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/18 "2019-12-13T18:51:21Z")

</div>

Can you post the text here?

---

<div class="post-metadata">

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

</div>

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

It should be, but so was Enigma; the weak link, as always is the human factor. For example; if the book was one you carry with you, other people might work out that it must be significant.

---

<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, 8:48pm UTC](https://boards.straightdope.com/t/anyone-here-know-anything-about-19th-century-commercial-ciphers-for-telegrams/844784/20 "2019-12-13T20:48:03Z")

</div>

Well, sure.  
Which is why humint is so important.

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