Cryptography A Bit of History 1 Seminal Text on Cryptography The Codebreakers: The Story of Secret Writing by David Kahn 1967 2 Early Cryptology - India Secret writing was well known and practiced in India India had a well organized espionage service - the country was riddled with spies The erotic textbook, the Kama-sutra, lists secret writing was one of the 64 arts that women should know and practice it is 45th in a list that begins with vocal music and runs through poetry 3 1
Early Cryptology - Hebrews Hebrew literature records three forms of letter substitutions atbah - the letters are numbered and the first nine are paired so that their value adds to 10, the remaining are paired so their value adds to 28 atbash - the last letter in the alphabet replaces the first, the next to the last replaces the second... albam - splits the alphabet in half and equates the two halves 4 The first recorded cryptographer was Early Cryptology - Greeks the Histories of Herodotus mention several methods of secret writing During a revolt against the Persians, word was sent by shaving the head of a slave, tattooing the message on his head and waiting for the hair to grow One of the most important messages in the history of early Western civilization was transmitted secretly. A Greek exile in Persia sent a warning 5 back to Sparta that Xerxes was going to invade Early Cryptology - English During the Middle Ages, cryptology, along with other arts and sciences, died out. The English monk, Roger Bacon, wrote about secret writing in the mid-1200 s (Secret Works of Art and the Nullity of Magic) Chaucer enciphered six short passages 6 2
Early Cryptosystems The Spartans were the first to use cryptography in the military They developed a device called a skytale it consists of a staff of wood around which a strip of papyrus or parchment is wrapped the secret message is written on the parchment down the length of the staff 7 when the parchment is unwrapped it appears Skytail Example T H I S I S F U N N Y Given the message: THIS IS FUNNY S T F H U I N S N I Y 8 Greek Cryptosystems The first text on cryptology was written by the Greeks a chapter in one of the earliest works on military science On the Defense of Fortified Places listed several systems One suggestion was to replace the vowels of the message with dots, one for alpha, two for epsilon, etc Another suggestion was to prick holes in a 9 3
Polybus Square Another Greek writer, Polybius, first suggested a method that is commonly used the letters are arranged in a square, numbering the rows and columns letters in a message are replaced by their row and column numbers 1 2 3 4 5 1 a b c d e 2 f g h i k 3 l m n o p 4 q r s t u 5 v w x y z THIS - 44 23 24 43 10 Black Chambers As Europe began to emerge from the Dark Ages, governments began to build large networks of spies They would communicate with their agents using ciphers so it was only natural that organizations would be developed whose goal was to read the ciphers of other nations These organizations were called black chambers and they became quite common during the 1700s The best was the Austrian black chamber in Vienna 11 Vienna Black Chamber 1 At 7 a.m., the mail on its way to the embassies in Vienna was first brought to the black chamber the letters were opened by melting their seals with a candle important parts of the letters were copied they were replaced, resealed with forged seals, and returned to the post office by 9:30 a.m. At 10 a.m. mail passing through Vienna to other points on the continent arrived. It was opened, read, resealed, and returned by 2 p.m. 12 4
Vienna Black Chamber 2 At 11 a.m. interceptions made by the police arrived At 4 p.m. letters send out by the embassies were brought in, opened, read, resealed and returned by 6:30 p.m. Overall, this 10 man organization handled an average of 80 to 100 letters a day 13 England England also had a Black Chamber Started in the mid-1600 s by John Wallis, perhaps the greatest English mathematician before Newton 14 Were the Black Chambers Legal? The statute of 1657 which established the postal service declared outright that the mails were the best means of discovering dangerous and wicked designs against the commonwealth The Post Office Act of 1711 permitted the government to open mail under warrants that they themselves issued so the government issued all-inclusive general warrants this is the legal precedent for today s wiretaps 15 5
16 Secure Systems Ciphers are only part of a complete security package System Hardware/Software Protocol Process for multi-round message exchange OP: encipher,... Actual Transformation Cipher: DES, RSA,... Cipher Algorithms 17 A Good Cipher Enciphering and deciphering should be efficient for all keys - it should not take forever to get a message. Easy to use. The problem with hard to use cryptosystems is that mistakes tend to be made. The strength of the system should not lie in the secrecy of your algorithms. The strength of the system should only depend the secrecy of your key. Kerckhoffs' Principle 18 6
Cipher Classification Ciphers Public Key Symmetric Key Unkeyed PublicKey Signature ID Random OneWay Hash Random Signature MAC Symmetric Classical Stream Block Transposition Substitution 19 Cipher Environment The typical communication environment for discussing ciphers is plaintext Alice eavesdrop Bob Eve 20 Cipher System If Alice and Bob use a cipher system, this environment becomes: Alice plaintext cipher key ciphertext cipher eavesdrop plaintext key Bob Eve 21 7
A simple cipher 22 Example Cipher A substitution cipher is one in which each character in the plaintext is substituted for another character in the ciphertext The Caesar Cipher replaces each plaintext character by the character 3 positions to the plaintext right 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 ciphertext D E F G H I J K L M N O P Q R S T U V W X W Z A B C 23 Example Operation plaintext 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 ciphertext D E F G H I J K L M N O P Q R S T U V W X Y Z A B C MESSAGE the word privacy does not appear in the united states constitution wkh zrug sulydfb grhv qrw dsshdu lq wkh xqlwhg vwdwhv frqvwlwxwlrq NOTE: the shift could be any value from 1 to 25 NOTE: It helps to remove spaces - WHY?? wkhzr ugsul ydfbg rhvqr wdssh dulqw khxql whgvw dwhvf rqvwl wxwlr q 24 8
Cryptanalysis How would you break the Caesar cipher? Try all 25 possible shifts This is easy to do by hand or by computer 25 Ciphertext Attacks There are five types of general attacks on a cipher designed to discover the key 1. ciphertext only: the cryptanalyst has only the cipher text 2. known-plaintext: the cryptanalyst knows both the ciphertext and its plaintext 3. chosen-plaintext: the cryptanalyst selects the plaintext used to create the ciphertext 4. adaptive-chosen-plaintext: the plaintext is selected based on previous plaintext-ciphertext pairs 5. chosen-ciphertext: the cryptanalyst selects the ciphertext to decode with known plaintext 26 9