1 / 60

Lecture 2 2013 Classical Encryption Techniques Dr. Nermin Hamza

Lecture 2 2013 Classical Encryption Techniques Dr. Nermin Hamza. Introduction. Cryptography Cryptography is the science of writing in-secret code and is an ancient art . The first documented use of cryptography in writing dates back to circa 1900 B.C. by Egyptian. Introduction (cont’d).

nicol
Download Presentation

Lecture 2 2013 Classical Encryption Techniques Dr. Nermin Hamza

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. Lecture 2 2013 Classical Encryption TechniquesDr. NerminHamza

  2. Introduction • Cryptography • Cryptography is the science of writing in-secret code and is an ancient art . • The first documented use of cryptography in writing dates back to circa 1900 B.C. by Egyptian.

  3. Introduction (cont’d) • Cryptography • DAVID KAHN at 1976 said at “coder breaker” : • Cryptology was born among the Arabs. • They were the first to discover and write down the methods of cryptanalysis • وقد نشر مجمع اللغة العربية ، بدمشق الجزء الأول من الكتاب ”علم التعمية و استخراج المعمى ”، سنة ١٩٨٧ ونشر الجزء الثاني سنة ١٩٩7 • للدكتور : محمد مراياتي ويحيى ميرعلم و محمد حسان الطيان

  4. Requirements • two requirements for secure use of symmetric encryption: • a strong encryption algorithm • a secret key known only to sender / receiver • mathematically have: Y = EK(X) X = DK(Y) • assume encryption algorithm is known • implies a secure channel to distribute key

  5. Some Basic Terminology • plaintext - original message • ciphertext - coded message • cipher-algorithm : for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext from plaintext

  6. Encryption Diagram Encryption algorithm Decryption algorithm Plain Text Cipher Text Plain Text Key Key

  7. Some Basic Terminology • cryptography - study of encryption principles/methods • cryptanalysis (codebreaking) - study of principles/ methods of deciphering ciphertext without knowing key • cryptology - field of both cryptography and cryptanalysis

  8. Cryptography • characterize cryptographic system by: • number of keys used • single-key or private / two-key or public • type of encryption operations used • substitution / transposition / product • way in which plaintext is processed • block / stream

  9. Cryptanalysis • objective to recover key not just message • general approaches: • cryptanalytic attack rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext-ciphertext pairs. • Brute-force attack try every possible key on a piece of cipher text until an intelligible translation into plaintext is obtained.

  10. Cryptanalytic Attacks • ciphertext only • only knows algorithm & ciphertext • known plaintext • know/suspect plaintext & ciphertext • chosen plaintext • select plaintext and obtain ciphertext • chosen ciphertext • select ciphertext and obtain plaintext • chosen text • select plaintext or ciphertext to en/decrypt

  11. Brute Force Search • always possible to simply try every key • most basic attack, proportional to key size • assume either know / recognise plaintext

  12. Cryptography types: • Symmetric cipher • Asymmetric cipher

  13. Symmetric cryptography : • Also called Secret Key Cryptography (SKC): Uses a single key for both encryption and decryption Plain Text Plain Text Cipher Text

  14. Asymmetric Cryptography : • Also called Public Key Cryptography (PKC): Uses one key for encryption and another for decryption Plain Text Cipher Text Plain Text

  15. The main two basic techniques • Substitution • Transposition

  16. Substitution Ciphers

  17. Classical Substitution Ciphers • where letters of plaintext are replaced by other letters or by numbers or symbols • or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with cipher text bit patterns

  18. Caesar Cipher • earliest known substitution cipher • by Julius Caesar • first attested use in military affairs • replaces each letter by 3rd letter on • example: M e e t m e a f t e r t h e t o g a p a r t y P H H W P H D I W H U W K H W R J D S D U W B

  19. Caesar Cipher • then have Caesar cipher as: c = E(p) = (p + k) mod (26) p = D(c) = (c – k) mod (26)

  20. Caesar Cipher • can define transformation as: 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 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 • mathematically give each letter a number 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 • then have Caesar cipher as: c = E(p) = (p + 3) mod (26) If p= a= 0 , E(a) = (0+3) mod 26 = 3 = D

  21. 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

  22. Caesar Example • Let k= 10 • Encrypt the following “Hello”

  23. Caesar Example • Let k= 10 • Encrypt the following “Hello” • H E L L O 7 4 11 11 14 17 14 21 21 24 • -----------------------(MOD 26) 17 14 21 21 24 R O V V Y

  24. Caesar Example • Let k= 9 • Encrypt the following “SUN”

  25. Caesar Example • Let k= 9 • Encrypt the following “SUN” S U N 18 20 13 27 29 22 -----------------------(MOD 26) 1 3 22 B D W

  26. Caesar Example • Let the cipher text = “IFMMP” and k =1 • What is the plain text? • P= (C-1) mod 26 • P = Hello

  27. Cryptanalysis of Caesar Cipher • only have 26 possible ciphers • A maps to A,B,..Z • could simply try each in turn • a brute force search • given cipher text, just try all shifts of letters • do need to recognize when have plaintext • eg. break cipher text "GCUA VQ DTGCM"

  28. Example for fun

  29. Monoalphabetic Cipher • rather than just shifting the alphabet • could shuffle (jumble) the letters arbitrarily • each plaintext letter maps to a different random ciphertext letter • hence key is 26 letters long Plain: abcdefghijklmnopqrstuvwxyz Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN Plaintext: ifwewishtoreplaceletters Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA

  30. Monoalphabetic Cipher Security • Could be another equation : • (a.i +b ) mod 26

  31. Monoalphabetic Cipher Security • now have a total of 26! = 4 x 1026 keys • with so many keys, might think is secure • but would be !!!WRONG!!! • problem is language characteristics

  32. Language Redundancy and Cryptanalysis • human languages are redundant • eg "th lrd s m shphrd shll nt wnt" • letters are not equally commonly used • in English E is by far the most common letter • followed by T,R,N,I,O,A,S • other letters like Z,J,K,Q,X are fairly rare • have tables of single, double & triple letter frequencies for various languages

  33. English Letter Frequencies

  34. Use in Cryptanalysis • compare counts/plots against known values • if caesar cipher look for common peaks/troughs • peaks at: A-E-I triple, NO pair, RST triple • troughs at: JK, X-Z • for monoalphabetic must identify each letter tables of common double/triple letters help

  35. Polyalphabetic Ciphers • polyalphabetic substitution ciphers • improve security using multiple cipher alphabets • make cryptanalysis harder with more alphabets to guess and flatter frequency distribution • use a key to select which alphabet is used for each letter of the message • use each alphabet in turn • repeat from start after end of key is reached

  36. Vigenère Cipher • simplest polyalphabetic substitution cipher • effectively multiple caesar ciphers • key is multiple letters long K = k1 k2 ... kd • ith letter specifies ith alphabet to use • use each alphabet in turn • repeat from start after d letters in message • decryption simply works in reverse

  37. Steps of Vigenère Cipher 1- write the plaintext out 2- Write your keyword across the top of the text you want to encipher, repeating it as many times as necessary. 3- encrypt the corresponding plaintext letter 4- eg using keyword deceptive key: deceptivedeceptivedeceptive plaintext: wearediscoveredsaveyourself ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ

  38. 5- For each letter, look at the letter of the keyword above it ,and find that row in the Vigenere table. 6- Then find the column of your plaintext letter 7- Finally, trace down that column until you reach the row you found before and write down the letter in the cell where they intersect

  39. Example • D and W  Z key: d e c e p t ivedeceptivedeceptive plaintext: w e a r e d iscoveredsaveyourself ciphertext: Z I C V T W QNGRZGVTWAVZHCQYGLMGJ

  40. Let key = MEC • Plain text : We need more supplies fast

  41. Let key = MEC • Plain text : • We need more supplies fast • Keyword: M E C M E C M E C M E C M E C M E C M E C M • Plaintext: w e n e e d m o r e s u p p l i e s f a s t

  42. Let key = MEC • Plain text : • We need more supplies fast • Keyword: M E C M E C M E C M E C M E C M E C M E C M • Plaintext: w e n e e d m o r e s u p p l i e s f a s t • Ciphertext: I I P Q I F Y S T Q W W B T N U I U R E U F

  43. Security of Vigenère Ciphers • have multiple ciphertext letters for each plaintext letter • hence letter frequencies are obscured • but not totally lost

  44. Play Fair • The keyword written into five-by-five square , omitting repeated letters and combining I and J in one cell. • Key: MANCHESTER

  45. Example of play fair

  46. Example of play fair matrix • “playfair example" as the key

  47. Example of play fair matrix • “Monarchy”

  48. Play Fair • Break the message into two-letter group. If both letters are the same : insert X between them. If only one letter add X letter • PLAIN: “THIS SECRET MESSAGE IS ENCRYPTED”

More Related