Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic.

Similar presentations


Presentation on theme: "Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic."— Presentation transcript:

1 Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic methods. Plaintext P = the original message. Encryption E k : Encoding the contents of the message to hides its contents from outsiders. Ciphertext C: The encrypted message. Decryption D k : The process of retrieving the plaintext from the ciphertext. Key K: Encryption and decryption usually make use of a key, and the coding method is such that decryption can be performed only by knowing the proper key. Cryptosystem= finite set of plaintexts P + finite set of ciphertexts C + set of keys K+ set of encryption functions E k and corresponding decryption functions D k for each key k from K, such that D k [E k (x)] = x. Cryptanalysis: is the art of breaking ciphers without knowing the proper key. Cryptographers: People who do cryptography. Cryptanalysts: practitioners of cryptanalysis.

2 General Process E=Plaintext P= Numerical Representation Encryption EDecryption D C=E(P)P=D(C) C= Ciphertext C= Numerical Represeantion

3 8.1. Character Ciphers Numerical Transformation: Restriction to the alphabet and to English  work modulo 26 (finite representation of large to infinite number of words/plaintexts) Letter ABCDEFGHIJKLMNOPQRSTUVWXYZ Nume rical value 0123456789 10101 1212 1313 1414 1515 16171818 1919 2020 212 2323 242525 Frequ ency in % 7134 133 238<1<1 <1<1 43873<1<1 869311<1<1 2<1<1

4 8.1.1. Caesar Cipher (Shift) Key: k between 1 and 25 Encryption: P  C= E(P) = P + k Decryption: C  P= D(C) = C – k Example with k=3: P= HEY = 7 4 24 C= P+ 3 (mod 26) = 10 7 27= 10 7 1 = KHA C=AHK = 1 7 10 P= C-3 (mod 26) = -2 5 7 = 24 5 7 = YEH

5 Cryptanalysis of Shift cipher Given C, find k and P? Use the frequency of letter. Example: C=YFXMPCESPZCJTDFDPQFWQZCPYNTASPCTYRXPDDLRPD Most frequent letters are (decreasing): P, C, D,F,T,Y Initial guess: E  P, thus E+k=P 4+ k = 15 (mod 26) k = 15-4=11 (mod 26) P=C-11 (mod 26) Thus P = NUMEBRTHEORYISUSEFULFORENCIPHERINGMESAGES = NUMEBR THEORY IS USEFUL FOR ENCIPHERING MESAGES

6 Cryptology Tools sectionCryptology Tools section(online PARI/GP) Frequency Count: cut-and-paste a block of text to return the counts of letters from A to Z.Frequency Count Letter Block Count: to count the frequency of blocks of consecutive letters (bigrams, trigrams, etc.) in a text.Letter Block Count Subtext Count: This tool gives the letter frequencies of a subtext of a given text, consisting of each n-th letter starting with the k-th one.Subtext Count Caesar Cipher: This tool encodes and decodes according to the simple shift cipherCaesar Cipher Affine Ciphers: This encodes and decodes texts by affine transformations.Affine Ciphers General Monoalphabetic Cipher: This encodes and decodes text using a monoalphabetic substitution.General Monoalphabetic Cipher Babbage-Kasiski Method: This tool tabulates repeated blocks in any text and gives the distances (in numbers of letters) between the repetitions. The method of Babbage and Kasiski involves looking for common factors in these distances as a guess for the length of the keyword. The distances are factored to aid this guess. Friedman's Method: This tool calculates the index of coincidence of any text and uses that to guess the length of the keyword (or more generally the number of alphabets in a polyalphabetic cipher).Babbage-Kasiski Method Friedman's Method Subtext Count: This is the same tool as mentioned above for counting subtext frequencies. Once you have a reasonable guess for the keyword length, use this tool to guess the individual keyword letters.Subtext Count Keyword Guesser: This tool is a shortcut that guesses the keyword based on the keylength and on identifying the most common cipher letter as the translation of `E'. This is not always a good choice!Keyword Guesser Frequency Chart Alignment: Use this tool to additively shift a ciphertext to fit the pattern of English letter frequencies.Frequency Chart Alignment

7 8.1.2. Affine Cipher P  C = a P + b C  P = ā (C – b) Key: a & b between 0 & 25 with (a,26)=1 Phi(26)= only12 possible values for a. Reminder:  Euler’s theorem: (a,26)=1 → a Φ(26) Ξ 1 (mod 26)  Corollary: (a,26)=1 → ā Ξ a Φ(26)-1 (mod 26)  Solving ax Ξ c (mod 26)  x Ξ ā c (mod 26) a1357911151719212325 ā 1921153197231151725

8 Cryptanalysis From C find x=a & y=b then P: C=xP+y? Use the most two frequent letters to create two linear equations with two unknown. C=JAPXMSJGYPGDZWJPGJEGHDSSLBGWPGJYHVPOODCJZDMYJW ZWFMGPCPSFBDBVHWNB Most frequent letters: G 7, J 7, P 7 Compare to most frequent letters in English: E 13, T 9, A 8, etc. Try J  E and G  T to get the equations: x E + y = J and x T + y = G Or again x 4 + y = 9 and x 19 + y = 6 (mod 26)

9 System of Linear Congruences a x + b y Ξ e (mod m) c x + d y Ξ f (mod m) Use material from section 4.2 if possible, or Use Theorems 4.17 -4.19 (page 179-181): Put If (∆, m)= 1, then the solution of the system is with the inverse of A mod 26:

10 Application to the example x 4 + y = 9 and x 19 + y = 6 (mod 26) (∆, m)= 1, inverse of ∆ (mod 26) is ∆¯ =19 to get: On Derive: MOD( ∆¯ MOD(DET(A)·A -1, 26), 26) On Maple: Mod( ∆¯ · Mod(Det(A)·A -1, 26), 26) Solution P=EXAMPLETHATICREATEDTOILLUSTRATEHOWAFFINECIPHERCRYPT ANALYSISWORKS EXAMPLE THAT I CREATED TO ILLUSTRATE HOW AFFINE CIPHER CRYPTANALYSIS WORKS

11 8.2 Block and Stream Ciphers Less vulnerable to cryptanalysis than Character Ciphers. Substitute for each block of plaintext letters of a specific length a block of ciphertext letters of the same length. Called Block or Polygraphic ciphers. They are symmetric algorithms (or secret-key), i.e., use the same key for encryption and decryption (or the decryption key is easily derived from the encryption key).

12 8.2.1 Vigenere Ciphers (see web & pages 287-292) Consists of a Keyword of length n: l 1 l 2 … l n It numerical equivalence is then: k 1 k 2 … k n Split plaintext into blocks of length n: p 1 p 2 … p n Transform it into ciphertext blocks: c 1 c 2 … c n Such that: c i = p i + k i (mod 26) for i =1,2,…,n or C=P+L C = (c 1, c 2, …, c n ) P= (c 1, c 2, …, c n ) L = (c 1, c 2, …, c n ) To decrypt: p i = c i - k i (mod 26) for i =1,2,…,n A dummy letter can be used for a terminal block of less than n letters

13 Hill Ciphers (1929, see pages 292-296) Consists of a Key matrix A=(k ij ) of size n x n Split plaintext into blocks P of length n. Transform it into ciphertext blocks C of length n. C = A P (mod 26) or to decrypt P = C (mod 26) Where A dummy letter can be used for a terminal block of less than n letters

14 Case of n=2; diagraphic ciphers

15 Cryptanalysis of polygraphic Ciphers Not vulnerable to letter frequency Vulnerable to frequency of blocks of size n. For n=2  26 2 = 676 diagraphs ( blocks of length 2) In English, the most common diagraphs with decreasing frequency: TH then HE So if TH  c 1 c 2 & HE  c 3 c 4 then solve for matrix A:


Download ppt "Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic."

Similar presentations


Ads by Google