Catherine

Ciphers

Definition of Cipher:

  • (Cambridge Dictionary): a system of writing that prevents most people from understanding the message
  • (Google) : a secret or disguised way of writing; a code

What sparked the idea?

The Imitation Game

2014 American Historical Drama film inspired by the biography Alan Turning: The Enigma

I watched this film a few years back and it stuck with me. Alan Turning, a British cryptanalyst, was tasked to find the secret of the German coded messages during World War II. Enigma, the machine used by the Nazis ton encode their messages, was a the time able to modify the code too fast to decipher.

The story stuck, and the concept have always been fascinating to me. Here is the time to do extended research on it.

Cryptanalyst: (Cambridge Dictionary) someone who studies secret code systems in order to obtain secret information

The Imitation Game Official Trailer





Research

Starting from enigma and defining ciphers, I then went to Wikipedia to get a list of classic and well known codes. I will be able to examine them more closely in the future. I will need to choose which ones to focus on, which one are more likely to catch interest.

Defenition of Cryptography:

  • (Merriam-Webster): secret writing; the enciphering and deciphering of messages in secret code or cipheralso : the computerized encoding and decoding of information. The word traces back to the Greek roots kryptos, meaning "hidden," and graphein, meaning "to write." "Kryptos"

First and foremost: how is a message encrypted?

You would need a specific pattern which changes the initial message into the final coded message. For example, the letter "a" would become "b", the letter "b" would become "c", etc. Here, the cypher itself would be the letter shifting. To decript the message, one would need a "key"; the rule the encrypting follows. Here, it would be that each letter shifts by one to the next letter in the alphabet.

Here is a blog, "Comment ça marche, le cryptage?" by Culture Informatique, in French, that helped me understand the basics of an encoded message. I do not believe this is a reliable source, rather a simple introduction to the subject.


“Comment Ça Marche Le Cryptage ?” Culture Informatique, 28 Sept. 2016, www.culture-informatique.net/comment-ca-marche-cryptage/.

I found a book that may help me further my understanding of codes. The author in it explains he ''Sought to`cover the major events, both external and internal, that have affected cryptology in the past quarter century.'' It will give insight on recent codes used in the world, examples of such codes, etc.

The book may be a little old, published in 1996, but since the subject is history\historical events, it do not need exactly up-t-date information. The writer, David Kahn, is an American historian, journalist, and writer specialising in the history of cryptography and military intelligence.


Kahn, David. The Codebreakers: The Comprehensive History of Secret Communication from Ancient Times to the Internet. Rev. ed. New York: Scribner, 1996.

Block Cipher

Code

Cipher

Cipher Text

Keyspace

Hash

Monoalphabetic Ciphers

Plain Text

Polyalphabetic Ciphers

Stream Cipher

Symmetric/Asymmetric Keys

Cryptanalysis

Frequency Analysis

What terms should I know before continuing on the subject?

In this next blog, "Famous codes and ciphers through history and their role in modern encryption" by Jon Watson, multiple terms frequently encountered when talking about codes, cyphers and encrypting are defined brievly. He also gives an introduction to some commonly seen cyphers.

While the author of this blog works in the field of internet security and often come across encrypting, this is still only a blog and was certainly not peer reviewed. Like the previous blog, I will use it as an introduction and a tramplin to further research on the cyphers he presents.


Watson, Jon. “Famous Codes & Ciphers through History & Their Role in Modern Encryption.” Comparitech, 13 May 2017, www.comparitech.com/blog/information-security/famous-codes-and-ciphers-through-history-and-their-role-in-modern-encryption/.

Enigma

Of course, the code that started the idea of this blog, Enigma, will be further researched.

Here is an historical book written bby Stephen Budiansky - author of a number of scholarly publications about the history of cryptography, military and intelligence history, and music - that seem to go in great details in the codes used in World War II, and most likely the most famous code of the period, enigma. I hope this book will help my research in the usage of the code, how it worked, how it was used and how it was broken. This source is reliable, the author has previously written in the subject.

Budiansky, Stephen. Battle of Wits. The Complete Story of Codebreaking in World War II. New York: Free Press, 2000.

Morse Code

This one may be very basic, but it's creation and uses should be very interesting nontheless.

I have found an archive of Instructions for Learning International Morse Characters, published by the United States Government's War department. I consider it reliable information, since it is a document shared with personal who would need to learn Morse code in order to often communicate in the code.

“TM 11-459 Instructions for Learning International Morse Characters : United States. War Department : Free Download, Borrow, and Streaming.” Internet Archive, United States War Department, 2 June 1943, archive.org/details/Tm11-459_676-nsia/page/n51/mode/2up.

Vigenère

The cipher I used in earlier examples, I can finally put a name to it. It is a more complex form of the Caesar Cipher. I will explain it further down the blog, after having introduced certain terms first.


Cryptology

Albrecht Beutelspracher



Thoughts on the book

The author, Albrecht Beutelspracher, is a german mathematician. He is known for popularizing mathematics and founding the first Mathematics Museum in Germany. I find it interesting that he wrote a book on cryptology. It gives insight about the relation of languages, encryption, decryption and mathematics.

The author is used to writing about a subject to explain it to general audiences and it shows in is explanations of the different ciphers he presents, the way to encrypt a message using thus cupher and the way it can be decrypted. He also extends a lot on algorythms, data processing and privacy. With each chapters there were exercises the reader could try to ensure they understood the concept with a more practical approach. It has been very helpful to be able to play with those ciphers myself and learn them this way.

Terms as defined in the book

  1. Cryptology: The art and science of designing methods in order to disguise messages
    • Cryptography: The science of designing cyphersystems
    • Cryptanalysis: The art of breaking cyphersystems
  2. Cleartext (or plaintext): The message we want to transmit
  3. Cipheretext: The sequence of letters and symbols that is transmitted
  4. Encyphering (or encrypting or encoding): The process of transforming cleartext to ciphertext
  5. Decifering (or decrypting or decoding): The process of transforming ciphertext to cleartext
  6. Cipher (or cypher): The system of all cleartexts, the corresponding ciphertexts, and the rule which assigns to any cleartext a ciphertext


Code Breaking: A History and Explanation

Rudolf Kippenhahn


Thoughts on the book

The author, Rudol Kippenhahn, is a German astrophysicist and science author. This a a reliable source which will serve as the basis for most of the history of cryptology. It may be a little old (1999), but it is an history book and does not need very up-to-date information to stull be useful. The book reads like a story. The flow is engaging, the subject fascinating. It explain each code in context instead of in a purely mathematical fashion.

Interesting comment about the translation of the book from Greman to English by the author: "This meant more than just the translation of the German examples, since the methods of decoding vary with different languages. Tricks that can be applied in one instance fail in another." (Kippenhahn, p.13)


Secret Language: Codes, Tricks, Spies, Thieves, and Symbols

Barry J. Blake



Thoughts on the book

The author, Barry J. Blake, is a linguist. He has published various book about languages. It is intersting to have an insight in secret language from another oint of view; another expert, more focused on the language and the communication aspect of cryptology rather than mathematical. This book uses a lot of examples and images to help understand the ciphers.



Code Breakers: World War II Saw an Explosion in Cipher Machine Technology That Called for Even More Sophisticated Code-Breaking Measures

Sarah R Cokeley


Thoughts on the book



Battle of Wits The Complete Story of Codebreaking in World War II

Stephen Budianski



Thoughts on the book



The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography

Simon Sigh



Thoughts on the book


Types of Ciphers

Transposition Ciphers

The letters remain what they are, but not where they were. A change in position.



EXEMPLES:

THE SPARTAN SCYTALE

2500 Years ago, used by the Spartan government to send messages to its generals.

Sender and recipient each had a cylinder of the same radius. The sender wound a narrow ribbon of parchment on the cylinder and wrote a message on it before sending only the ribbon. Those who had a cylinder of the same length as the sender's could read the message clearly.

Substitution Ciphers

Each letter of the cleartext keeps it's position, but is replaced by another letter or a symbol.



EXEMPLES:

Monoalphabetic Cipher

Those ciphers always retain the same numbers of letters as the original language.

ADDITIVE CIPHER (OR SHIFT CIPHER, OR CAESARE'S CIPHER)

Used in 100-44 BCE by Gaius Julius Caesar.

We use a key - in this case a number, which indicate the positions the letters are shifting.

Cryptanalysis: There are 26 possible additive ciphers. It isn't such a great number, and so those who have the time can decrypt a message very easily by trying each one until the message makes sense. This work best on longer messages since words with more letters have less possibilities of making sense with different combinations of letters.

Stastical Analysis

Knowing the language of the cleartext and which letters of this specific languages come up more often.

EXEMPLE: English

By looking for the letter or symbol coming more often in the cybertext, one can assume that they have found the letter e. However, that is not always the case. The next step would be to determine if the letters v, w, x, y, z, based on what they should be if the previously found letter is e, are absent or not reccuring often. If so, then it is a good sign.

This works better on longuer texts to decrypt.

Affine Ciphers

Considering the 26 letters of the English language all have a number, the key here is another number, that you can either add to the letter's number by.

Ex: Cleartext: A=1 Ex: Cleartext: A=1

Key: +4 Key: +4

Ciphertext: A=5 Ciphertext: A=D

Keywords

We choose a keyword and a key. The letters of the keyword will stay in that order. The key is the letter at which the keyword starts.

Ex: Keyword = cryptanalysis (cryptanlsi) Key = e

a b c d e f g h i j k l m n o p q r s t u v w x y z

c r y p t a n l s i

After that, we fill out the remaining letters in alphabetical order after the keyword.

Vigenère Cipher

Beutelspacher, Albrecht. Cryptology : An Introduction to the Art and Science of Enciphering, Encrypting, Concealing, Hiding, and Safeguarding Described without Any Arcane Skullduggery but Not without Cunning Waggery for the Delectation and Instruction of the General Public. Mathematical Association of America, 1994. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=cat01165a&AN=dawson.47694&site=eds-live&scope=site.

Background

This cypher was created by the French Diplomat Blaise de Vigenère in 1586. HIs idea was to use multiple monoalphabetic ciphers in one cipher in order to make it that much more difficult to decrypt.

The Vigenère Cipher is the most popular polyalphabetic cipher. Many of the ciphers officially used by countries in history were based on the Vigenère Cipher.

To encrypt a cleartext or to decipher a ciphertext in the Vigenère Cipher, we need first and foremost a Vigenère Square (See image on the right). It's a table with all 26 possibilities of a Caesarian Cipher. Next, a keyword is needed.

ex: Keyword: KEYWORD

Cleartext: This is a cleartext

Next, we need to repeat the keyword's letters next to the cleartext's letters over and over until the end of the clear text.

ex: Keyword: K E Y W O R D K E Y W O R D K E

Cleartext: T h i s i s a c l e a r t e x t

Now, to encypher the cleartext: the letters of the keyword correspond to the row on the Vigenère Square, and the letters of the cleartext correspond of the columns on the Vigenère Square. The point where the row and column meet will be the letter of the enciphered text.

ex: Keyword: K E Y W O R D K E Y W O R D K E

Cleartext: T h i s i s a c l e a r t e x t

Ciphertext: D l g o w j d m p c w f k h h x

Ciphertext: Dlgo wj d mpcwfkhhx

This cipher renders the cryptanalysis technique of looking for relative letter frequency inneffective.

Cryptanalysis of Vigenère

Background

The first published successful attack on the Vigenère Cipher was done in 1863 by the Prussian colonel Freidrich Wilhelm Kasiski. (Beutelspracher, Cryptology, p.29) The important contribution of the English mathematician Charles Babbage to this method should be mentionned.

The second successflu attack was done by the American William Frederick Friedman.

The Kasiski Test


The Friedman Test


It is to be noted that both of the methods above need the keywod of the cipher to be relatively short in order to work. Some Vigenère Ciphers can have keywords as long as the cleartext, for example if the keyword is a sentence or a paragraph. But if the keyword is indeed a text, then the statistics of probablitites of the English lanues also applies and should be noticeable. This was found by Frieman, again, in 1920.

However, the keywords could be a long sequence of random letters.

Ciphers and Security

Authentification

How to make sure the message hasn't been intercepeted and tempered with?

Digital Signatures

Timeline - Evolution of Ciphers

480 BCE - Battle of Thermopylae

Greece

At the time, messages were written in a layer of wax spread on a plank of wood. Before the battle between King Leonidas of Sparta and the Persian dforces, a Greek living in Persia carved a warning on the wood before writing a mundane message on the wax that covered it.

However, the message didn't change the outcome of the fight; the Greek were betrayed and the Persian army were able to get through a hidden passage the encircle the Greek army.

100-44 BCE - Julius Caesar

Rome

1586 - The Death of Mary Stuart

England

The reign of Elizabeth I, the Queen of England at the time, was full of conspiracies as the religious tensions between the recently instored Protestantism and the old Catholicism brew. The importance of a secret police and an emphasis on the decryption on ciphers is quicly established. Enters Mary Stuart, Queen of Scots, a Catholic who could have a legitimate claim to the throne of the Protestant Queen Elizabeth, asking for asylum in England. She is put under house arrest and constant surveillance, and in 1586 she receives letters suggesting a rebellion from her followers. It is encrypted, but the ever vigilant secret police had been producing copies of all her messages for years and managed to crack the code. When Mary Stuart gives a favorable response to these letters, she is arrested and executed.

1867 - The Cipher Template, or "Turning Grille"

Inspired by the tensions in Austria after the loss of the Battle of Königgrätz against Prussia and the remains of the Hungarian revolution movment, Jules Vernes wrote "Mathias Sandorf", in which a message is sent in a code. Vernes describe the key of this cipher as a "turning grille", a cipher template (see image). It is placed on a table of letters and reveal only the letters of the message. The template can be turned three times to continue the message, clockwise.

WWI - The Zimmermann Telegram


1941 - WWII

Japan to Russia

The spy Richard Sorge sent a coded message to the Fourth Department in Moscow signaling that the Japanese forces would not attack the Soviet Union. This permitted the Soviet forces posted in Siberia in wait for an attack from the East to be reappointed and regrouped with the main forces against Hitler in Moscow.

The radio operator, Max Klausen, was the one who encoded the text, Richard Sorge was the spy, and Hotsumi Ozaki was the inside souce. All three of them were arrested in October 1941, but not before they could warn the Soviet Union. The Japanese never deciphered their code. Sorge and Ozaki were hanged, but Klausen was rescued by the Allies and lived under another name until 1964.

The code had numerous steps. First, the letters were substitutionned by numbers. To do so, they were arranged in a table of six rows, the first of which was the keyword "SUBWAY". Then, Klausen assigned the number 0 to 7 from up and down, left to right, to the letters "asintoer". He filled the rest with the numbers 80 to 99 from up and down, left to right.

"No/attack"

"729456658088"

This was the provisionally encoded text. After this, to avoid repeating proeminent letters in the language (here, the letter e would have been 3), was the next step: taking numbers from the book "Statistical Yearbook of the German Reich (1935)" and take a random page with a table of numbers. Klausen would pick a row and a column of number and start additionning, but without carrying the ten to the preceding place (not 7 + 8 = 15 but 7 + 8 - 5), the last two digits of these numbers to the provisionally encoded text.

He would then need to communicates which page and number he used as a key. Klausen would use the last two digits of the page number, the number of the row and the number of the column together.

ex: Page 234, 134, 34 all become 34. Row 23. Column 6. Final number: 34236

Klansen would then take a step further and addition the number made by the 5 first digit of the encrypted text to the digits representing the page, row and column. He would then place the number that resulted before the encrypted text, which gives the final encyphered message.

Ex: 36687 02451 23301 72

Provisionally Encoded Text

This subject was very fun to research. I liked trying to encrypt and decrypt my own messages in order to better understand the ciphers.

It was fascinating realizing the role coded messages played in history and how it is still prevalent today - notably with algorythms. The issue of privacy

Note to myself:https://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma https://en.wikipedia.org/wiki/The_Imitation_Game https://en.wikipedia.org/wiki/Alan_Turing:_The_Enigma https://www.worldatlas.com/articles/what-was-the-enigma-machine.html https://www.comparitech.com/blog/information-security/famous-codes-and-ciphers-through-history-and-their-role-in-modern-encryption/ https://en.wikipedia.org/wiki/Morse_code https://www.culture-informatique.net/comment-ca-marche-cryptage/ https://searchsecurity.techtarget.com/definition/encryption http://eds.b.ebscohost.com/eds/detail/detail?vid=5&sid=81f746ba-ebd6-4b69-9510-d1847253e358%40pdc-v-sessmgr01&bdata=JnNpdGU9ZWRzLWxpdmUmc2NvcGU9c2l0ZQ%3d%3d#AN=89407482&db=ers https://dc153.dawsoncollege.qc.ca:2238/ps/i.do?p=AONE&u=west74079&id=GALE%7CA508887082&v=2.1&it=r&sid=ebsco
Kippenhahn, Rudolf. Code Breaking : A History and Exploration. Overlook Press, 1999. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=cat01165a&AN=dawson.54236&site=eds-live&scope=site. Cokeley, Sarah R. “Code Breakers: World War II Saw an Explosion in Cipher Machine Technology That Called for Even More Sophisticated Code-Breaking Measures.” Military History, no. 5, 2015, p. 52. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=edsgao&AN=edsgcl.387952413&site=eds-live&scope=site.
Jérôme MARCHAND. “Battle of Wits The Complete Story of Codebreaking in World War II Stephen Budiansky.” Politique Étrangère, vol. 67, no. 3, 2002, p. 809. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=edsjsr&AN=edsjsr.42676425&site=eds-live&scope=site.
Beutelspacher, Albrecht. Cryptology : An Introduction to the Art and Science of Enciphering, Encrypting, Concealing, Hiding, and Safeguarding Described without Any Arcane Skullduggery but Not without Cunning Waggery for the Delectation and Instruction of the General Public. Mathematical Association of America, 1994. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=cat01165a&AN=dawson.47694&site=eds-live&scope=site.
Blake, Barry J. Secret Language. Oxford University Press, 2010. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=cat01165a&AN=dawson.68950&site=eds-live&scope=site.
Kippenhahn, Rudolf. Code Breaking : A History and Exploration. Overlook Press, 1999. EBSCOhost, search.ebscohost.com/login.aspx?direct=true&db=cat01165a&AN=dawson.54236&site=eds-live&scope=site.
Eliot A. Cohen. “The Code Book: The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography Simon Singh.” Foreign Affairs, vol. 78, no. 6, 1999, p. 148. EBSCOhost, doi:10.2307/20049567.