1 / 15

Cryptography

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.

abedi
Télécharger la présentation

Cryptography

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 Ek :Encoding the contents of the message to hides its contents from outsiders. • Ciphertext C: The encrypted message. • Decryption Dk : 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+ setof keys K+ set of encryption functionsEkand corresponding decryption functionsDkfor each key kfromK, such thatDk[Ek(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 E Decryption 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)

  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 section(online PARI/GP) • Frequency Count: cut-and-paste a block of text to return the counts of letters from A to Z. • Letter Block Count: to count the frequency of blocks of consecutive letters (bigrams, trigrams, etc.) in a text. • 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. • Caesar Cipher: This tool encodes and decodes according to the simple shift cipher • Affine Ciphers: This encodes and decodes texts by affine transformations . • General Monoalphabetic Cipher: This encodes and decodes text using a monoalphabetic substitution. • 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). • 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. • 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! • Frequency Chart Alignment: Use this tool to additively shift a ciphertext to fit the pattern of English letter frequencies.

  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)

  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=JAPXMSJGYPGDZWJPGJEGHDSSLBGWPGJYHVPOODCJZDMYJWZWFMGPCPSFBDBVHWNB • 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=EXAMPLETHATICREATEDTOILLUSTRATEHOWAFFINECIPHERCRYPTANALYSISWORKS • 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 Keywordof length n: l1 l2… ln • It numerical equivalence is then: k1 k2… kn • Split plaintext into blocks of length n: p1 p2… pn • Transform it into ciphertext blocks: c1 c2… cn Such that: ci = pi + ki (mod 26) for i=1,2,…,n or C=P+L C =(c1, c2, … , cn) P=(c1, c2, … , cn) L =(c1, c2, … , cn) To decrypt: pi = ci - ki (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 matrixA=(kij)of sizen x n • Split plaintext into blocksPof lengthn. • Transform it into ciphertext blocksCof lengthn. 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  262 = 676 diagraphs (blocks of length 2) • In English, the most common diagraphs with decreasing frequency: TH then HE • So ifTH  c1c2 & HE  c3c4 then solve for matrix A:

More Related