Download presentation
Presentation is loading. Please wait.
Published byDerrick Berry Modified over 8 years ago
1
CPIS 312 Chapter Two: Classic Cryptography By Dr. Daniyal Alghazzawi 2011 Term 2
2
Index A. Ciphers B. Classic B.1 Substitution e.g., Caesar Cipher B.2 Transposition e.g., Route Cipher B.3 Hybrid C. Modern C.1 Symmetric (Private Key) Stream Cipher e.g., RC4, A5/1 Block Cipher e.g., DES, AES C.2 Asymmetric (Public Key) e.g., RSA C.3 Hybrid
3
A. Terminology Cryptology is the art and science of making and breaking “secret codes.” Cryptography is the making of “secret codes.” Cryptanalysis is the breaking of “secret codes.” Crypto is a synonym for any or all of the above (and more). Cipher ( صفر ) is an algorithm for performing encryption and decryption — a series of well-defined steps that can be followed as a procedure. 3
4
Terminology Encryption is the process of encoding a message so that its meaning is not obvious Equivalent terms: encode, encipher Decryption is the reverse process, transforming an encrypted message back into its normal, original form Equivalent terms: decode, decipher Plaintext Ciphertext Encrypt Decrypt 4
5
Terminology Encryption/decryptions algorithms often use a device called a key, so that the resulting ciphertext depends on the original plaintext message, the algorithm, and the key value An encryption scheme that does not require the use of a key is called a keyless cipher Plaintext Ciphertext Encrypt Decrypt 5
6
Terminology Plaintext: message to be encrypted Ciphertext: encrypted message D K (E K (P)) = P 6
7
Symmetric uses same key for encryption and decryption process. To encrypt: C = E(K, P) To decrypt: P = D (K, E(K,P)) Asymmetric uses different key for encryption and decryption process. To encrypt: C = E (K E,P) To decrypt: P = D (K D, E (K E,P)) Terminology 7
8
Real Story In the spring of 1942, the United States was fighting Japan in the Pacific. American cryptanalysts had cracked some of the Japanese naval codes, but they didn't understand the extra encoding the Japanese used to describe particular sites. A message intercepted by the United States told the Allies' officers that "AF“ was to be the target of a major assault. The U.S. Navy suspected that the assault would be on Midway island, but it needed to be sure. Commander Joseph Rochefort, head of the U.S. Navy's cryptography center at Pearl Harbor, devised a clever plan to unearth the meaning of "AF." He directed the naval group at Midway to send a message, requesting fresh water because the water distillery had been damaged. Soon, the United States intercepted a Japanese message indicating that "AF" was short of water verifying that "AF“ indeed meant Midway! [SEI01] Hidden Meanings Change the Course of World War II:
9
Index A. Ciphers B. Classic B.1 Substitution e.g., Caesar Cipher B.2 Transposition e.g., Route Cipher B.3 Hybrid C. Modern C.1 Symmetric (Private Key) Stream Cipher e.g., RC4, A5/1 Block Cipher e.g., DES, AES C.2 Asymmetric (Public Key) e.g., RSA C.3 Hybrid
10
B. Classic Cipher 1. Substitution Ciphers: exchange one letter (or more) with another letter/number/symbol/sound/art A mono-alphabetic cipher uses fixed substitution over the entire message, A poly-alphabetic cipher uses a number of substitutions at different times in the message 2. Transposition Ciphers: re-arrange the order of the letters 10
11
B.1. Substitution Ciphers 1. Caesar Cipher Idea: each letter or group of letters is replaced by another letter or group of letters Caesar cipher – circularly shift by 3 letters a -> D, b -> E, … z -> C More generally, shift by k letters, k is the key 11
12
B.1. Substitution Ciphers 1. Caesar Cipher It is monoalphabetic cipher uses addition modulo 26 The message must be a sequence of letters, each letter is identified with a number: The key k is a number in the range 1 … 25. Advantages and Disadvantages: The Caesar cipher is quit simple The ability of predict the entire algorithm using small piece of ciphertext 12
13
B.1. Substitution Ciphers 1. Caesar Cipher (Programming) Encryption/decryption involve ± k to each letter (mod 26). So the general Caesar algorithm is C i = E k (M i ) = E(M i, k) = (M i +k) mod 26 M i = D k (C i ) = D(C i, k) = (C i -k) mod 26 For example, Plaintext : treaty impossible Key : ± 3 Ciphertext: wuhdwb lpsrvvleoh That is, C i =E[M i, 3] = M i +3 mod 26 13
14
Real Story Arrested in Sicily in April 2006, the reputed head of an Italian Mafia family, Bernardo Provenzano, made notes, pizzini in the Sicilian dialect. When arrested, he left approximately 350 of the notes behind. In the pizzini he gives instructions to his lieutenants regarding particular people. Instead of writing the name of a person, Provenzano used a variation of the Caesar cipher in which letters were replaced by numbers: A by 4, B by 5, … Z by 24 (there are only 21 letters in the Italian alphabet). So in one of his notes the string "…I met 512151522 191212154 and we agreed that we will see each other after the holidays…," refers to Binnu Riina, an associate arrested soon after Provenzano [LOR06]. Police decrypted notes found before Provenzano's arrest and used clues in them to find the boss, wanted for 40 years. All notes appear to use the same encryption, making them trivial to decrypt once police discerned the pattern. Suggestions we might make to Sig. Provenzano: use a strong encryption algorithm, change the encryption key from time to time, and hire a cryptographer. Mafia Boss Uses Encryption:
15
B.1. Substitution Ciphers 2. Tap Code Each letter is replaced by a number of beeps 15
16
B.1. Substitution Ciphers 3. Pigpen Cipher Each letter is replaced by an art 16
17
B.1. Substitution Ciphers 4. Vigenère Cipher Polyalphabetic ciphers flatten the frequency distribution of the plaintext considerably. Vigenère Cipher is an example of polyalphabetic ciphers - use different monoalphabetic substitutions as one proceeds through the plaintext message. For example: Plaintext (M)meet me at ten Key (K)badb ad ba dba Ciphertext(C)nehu mh bt wfn where C = M+K mod 26 17
18
B.1. Substitution Ciphers 4. Vigenère Cipher Vigenère Tableau 18
19
B.1. Substitution Ciphers 5. Codebook Cipher Each word is replaced by another numbers 19
20
B.1. Substitution Ciphers 6. Book Cipher Any book can provide a key The key is formed from the letter of the text Steps: 1. select a passage (Key) “the page cannot be found” 2. match the plaintext with selected text. Plaintext “MACINES CANNOT THINK” 3. encode plaintext using Vigenere table 20
21
B.1. Substitution Ciphers Cryptanalysis 1. Brute force cryptanalysis: would have to try 26! permutations of a particular ciphertext message 2. Frequency Distribution Analysis: In practice, it is not difficult to determine the key using frequencies of letters, pairs of letter etc., or by guessing a probable word or phrase Most frequently occurred Letters: e, t, o, a, n, … Digrams: th, in, er, re, an, … Trigrams: the, ing, and, ion, ent Words: the, of, and, to, a, in, that, … 21
22
Modula always return non-negative number: E.g., (-57) mod 21 = (-36) mod 21 = (-15) mod 21 = (6) mod 21 =6 Calculation Negative MOD
23
B.1. Substitution Ciphers 7. One-Time Pads 23
24
B.1. Substitution Ciphers 7. One-Time Pads (using Bits) One-time pad: construct an unbreakable cipher Choose a random bit string as the key Convert the plaintext into a bit string Compute the XOR of these two strings, bit by bit The resulting ciphertext cannot be broken, because in a sufficiently large sample of ciphertext, each letter will occur equally often, as will every diagram, every trigram, and so on => There is simply no information in the message because all possible plaintexts of the given length are equally likely The Vernam Cipher is a type of one-time pad devised by Gilbert Vernam for AT&T 24
25
B.1. Substitution Ciphers 7. One-Time Pads (using ASCII Code) Plaintext VERNAMCIPHER Numeric Equivalent 214171301228157417 + Random Number 7648168244358116054788 = Sum 9752339544156019751251105 = mod 26 19071718158192312251 Ciphertext tahrspitxmzb tahrspitxmzb Numeric Equivalent 19071718158192312251 - One-time pad 7648168244358116054788 = Difference-57-48-9-65-2612-508-377-22-87 = mod 26 214171301228157417 Plaintext VERNAMCIPHER 25
26
B.1. Substitution Ciphers 7. One-Time Pads Observations: The repeated letter t comes from different plaintext letters Duplicate ciphertext letters are generally unrelated when this encryption algorithm is used => there is no information in the message to be exploited Disadvantages The key cannot be memorized, both sender and receiver must carry a written copy with them Absolute synchronisation is between sender and receiver, otherwise, it fails completely to protect message integrity) 26
27
Real Story During World War II, the British Special Operations Executive (SOE) produced codes to be used by spies in hostile territory. The SOE devised poem codes for use in encrypting and decrypting messages. For security reasons, each message had to be at least 200 letters long. To encode a message, an agent chose five words at random from his or her poem, and then assigned a number to each letter of these words. The numbers were the basis for the encryption. To let the Home Station know which five words were chosen, the words were inserted at the beginning of the message. However, using familiar poems created a huge vulnerability. For example, if the German agents knew the British national anthem, then they might guess the poem from fewer than five words. As Marks explains, if the words included "'our,' 'gracious,' 'him,‘ 'victorious,' 'send,' then God save the agent" [MAR98]. For this reason, Leo Marks' job at SOE was to devise original poems so that "no reference books would be of the slightest help" in tracing the poems and the messages. Poem Codes:
28
Index A. Ciphers B. Classic B.1 Substitution e.g., Caesar Cipher B.2 Transposition e.g., Route Cipher B.3 Hybrid C. Modern C.1 Symmetric (Private Key) Stream Cipher e.g., RC4, A5/1 Block Cipher e.g., DES, AES C.2 Asymmetric (Public Key) e.g., RSA C.3 Hybrid
29
B.2. Transposition Ciphers Transposition cipher – reorders (rearrange) symbols but does not disguise them. It is also called permutation With transposition, the cryptography aims for diffusion Widely spreading the information from the message or the key across the ciphertext Transpositions try to break established patterns 29
30
B.2. Transposition Ciphers 1. Route Cipher 30
31
B.2. Transposition Ciphers 2. Rail Fence Cipher 31
32
B.2. Transposition Ciphers 3. Columnar Transposition Plaintext written in rows Number of columns = key length Key is used to number the columns Ciphertext reads out by columns, starting with column whose key letter is lowest 32
33
B.2. Transposition Ciphers 3. Columnar Transposition For example: Plaintext (M): WE ARE DISCOVERED FLEE AT ONCE Key (K): 6 3 2 4 1 5 Ciphertext(C): EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE 33
34
Index A. Ciphers B. Classic B.1 Substitution e.g., Caesar Cipher B.2 Transposition e.g., Route Cipher B.3 Hybrid C. Modern C.1 Symmetric (Private Key) Stream Cipher e.g., RC4, A5/1 Block Cipher e.g., DES, AES C.2 Asymmetric (Public Key) e.g., RSA C.3 Hybrid
35
Real Story Kahn describes a system that the Soviet Union thought unbreakable during World War II. It combined substitution with a one-time pad. The basic idea was to diffuse high-frequency letters by mapping them to single digits. This approach kept the length of cryptograms small and thus reduced the on-air time as the message was transmitted. To see how the encryption worked, consider the eight most common letters of the English language: ASINTOER, arranged as in "a sin to er(r)" to make them easy to remember. These letters were assigned to single digits, 0 to 7. To encode a message, an analyst would begin by selecting a keyword that became the first row of a matrix. Then, the remaining letters of the alphabet were listed in rows underneath, as shown below. Moving vertically through the matrix, the digits 0 to 7 were assigned to the eight common letters, and then the two-digit groups from 80 to 99 were mapped to the remaining letters of the alphabet plus any symbols. Soviet Encryption During World War II:
36
Real Story In our example, the keyword is SUNDAY: Then the message "whereis/456/airborne" would be encoded as or 99983431 09344556 69361480 7423. (Digits of plaintext numbers were repeated.) Finally, the numerical message was encrypted with a one-time pad from a common reference book with numerical tablesone that would not arouse suspicion, such as a navigator's book of tables. Continue…
37
Encryption & Decryption Plaintext & Ciphertext Algorithm & Cipher Cryptology Cryptography & Cryptanalysis Key Substitution & Transposition Monoalphabetic Ciphers & Polyalphabetic Ciphers Terms and Concepts 37
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.