cryptography basics
play

Cryptography Basics Part 1: Concepts Cryptology: Contents - PowerPoint PPT Presentation

Cryptography Basics Part 1: Concepts Cryptology: Contents Cryptography goals Encryption principles Encryption quality Cryptography Public key cryptography The art of making Next week: Example algorithms DES, AES, AES


  1. Cryptography Basics Part 1: Concepts

  2. Cryptology: Contents  Cryptography goals  Encryption principles  Encryption quality Cryptography  Public key cryptography The art of making Next week:  Example algorithms  DES, AES, AES  Encrypting larger messages Cryptanalysis  `Provably secure’ crypto The art of breaking 2

  3. Security Goals and Cryptography  Confidentiality  Authenticity  Data integrity  Non-repudiation  Privacy  Availability 3

  4. Example: What’s the message Greetings to all at Oxford. Many thanks for your letter and for the summer examination package all Entry forms and Fess Forms should be ready for final dispatch to the Syndicate by Friday 20 th or at the very latest, I’m told, by the 21 st . Admin has improved here, though there’s room for improvement still; just give us all two or three more years and we’ll really show you! Please don’t let these wretched 16+ proposals destroy your basic A and O pattern. Certainly this sort of change, If implemented immediately would bring chaos. 4

  5. Another Example: What’s the message Welcome back to Oxford. Thanks again, this letter explains the winter examination method and its related forms. Early submission does guarantee full and early feedback but does not influence the grading of the quality of the work done. A full grade report will be available once the deadline for submissions has passed. In it the evaluation is explained. The evaluation is final as the criteria for the work are now known. 5

  6. Final Example: What’s the message A final greeting to our Oxford graduates. Though with a slight delay, we hope this letter finds you well. The new variation in the forms attached shows how our alumni will continue to play a key role in our school and will not be forgotten. Instead we hope that you continue to work with us, and any contribution that you can bring, either directly or indirectly, will be appreciated. 6

  7. Algorithms + keys “gfd6#Q” “attack” “sdwr$350” encrypt decrypt Cipher (aka cryptosystem) “Public” algorithm + Secret keys (Kerckhoffs’ principle) 7

  8. When is message `safe’?  Suggestion 1: `cannot know the message’.  Kill the king with a @#$%~!.  Suggestion 2: `cannot know even a single bit’.  99% chance “Kill the king”, 1% “Drink coffee”...  ... lets find a definition...  For ciphertext each plaintext equally likely  Can this be done? 8

  9. Yes(*)!: One time pad  Vernam’s one time pad is information theoretically secure Why? plaintext bits key bits Bitwise xor ciphertext bits Note: random key equally long as message 9

  10. In 1 In 2 Out XOR 0 0 0 0 1 1  XOR truth table: 1 0 1 1 1 0  Addition modulo 2  Property: (c + k) + k = c  Repeat operation to `undo’.  If k `random’  (c+k) random  independent of c (!) 10

  11. Some History: the Caesar cipher  Monoalphabetic substitution  Replace letter by letter 3 places further Plaintext A B C D E F G H … Ciphertext D E F G H I J K …  Example: “attackatdawn” “dwwdfndwgdzq”  Letter frequency undisturbed  Nr of keys: 26 (25) A=1, B=2, C=3, … Encrypt: C = P+3 Decrypt: P = C-3 12

  12. Vigenere cipher  Polyalphabetic substitution  Key is keyword  Encrypt: Add keyword (letter by letter)  Modulo 26 with A=0, B=1, etc.  Decrypt: Subtract keyword  Example wearediscoveredsaveyourself deceptivedeceptivedeceptive + ZICVTWQNGRZGVTWAVZHCQYGLMGJ 14

  13. Cryptanalysis – plaintext structure E: 12% T: 9 %  (English) Text A,I,N,O,R: 8%  Distribution of characters known  Distribution of bi-graphs also known:  Data TH: 3.2% HE: 3.1 %  Format known ER: 2.1% <account>87539</account > <amount>1234</amount> 15

  14. Transposition cipher  Change order of letters in the message “meet me after the toga party” M e m a t r h t g p r y e t e f e t e o a a t “mematrhtgpryetefeteoaat” 16

  15. Modern Block Cipher  Principle: Combine n bit plaintext block  Confusion (substitution)  Diffusion (transposition)  Design: Iterate a round encrypt decrypt function  Two common types: n bit ciphertext block  Feistel network (e.g. DES)  Substitution-permutation network (e.g. AES) More on this next week – Now first: asymmetric (public key) cryptography 17

  16. Many symmetric keys needed Bob Carol Zeke ... To send to Alice, everyone Alice needs a different key To receive, Alice needs all these keys 18

  17. Asymmetric (public) key Bob Carol Zeke To send to Alice, everyone Alice uses her public key To receive, Alice needs a single private key 19

  18. Asymmetric keys Encrypt with Public Key Decrypt with Private Key 20

  19. Authenticity - Symmetric 21

  20. Authenticity - ASymmetric All can `sign’ only Alice check: message for Alice.

  21. Authenticity - ASymmetric Digital signature: reverse role encryption – decryption Alice can Sign, All can check: is a message from Alice

  22. Key Asymmetric Symmetric Distribution Obtain public key Establish shared key  Authenticity  Confidentiality Storage Public keys Many keys  Tampering  Confidentiality  Tampering Private keys  Confidentiality Revocation Don’t know where Bilateral  Check key status

  23. Diffie Hellman key exchange (1976) random y random x a x mod p r a y mod p r x mod y mod   key r p key r p Basis: Discrete log is hard public: prime p (for large numbers – e.g. 1024 bits) gen. a i mod  a, b, b a p i

  24. DH - Soundness and Security  Alice key equals   x   x y xy r mod p a mod p mod p a mod p  Bobs key equals   y   y x xy r mod p a mod p mod p a mod p  Eavesdropper sees A E B a x mod p x ' x a a y mod a p  Vulnerable to man-in- y ' y a a the-middle attack 26

  25. Cryptography Basics Part 2: Block Modes

  26. Encrypting Larger messages  Seen methods to encrypt block  Split into blocks (padding to fill last block)  Treat blocks separately? “attack at dawn” ascii 97 116 116 97 99 107 32 97 116 32 …. binary 32 bits block 01100011 01101011 00100000 01100001 28 Block representation of text

  27. ECB mode block block encrypt encrypt block block  Same plaintext block maps to same ciphertext block  Reordering, replacing possible  No error propagation  Bit changes only  Bit deletions/omissions are a problem 29

  28. Example: Mickey Mouse  Original picture 30

  29. Example: Mickey Mouse  Encrypted in ECB mode 31

  30. Encrypting larger messages  Operation modes  Electronic codebook (ECB)  Cipher Block Chaining (CBC)  Cipher Feedback (CFB)  Output Feedback (OFB) 32

  31. CBC mode IV block block encrypt encrypt block block  Same plaintext block maps to different ciphertext block  Reordering, replacing not possible  Depending on previous block  Limited error propagation  Affects only current and next block 33

  32. Example: Mickey Mouse  Original picture 34

  33. Example: Mickey Mouse  Encrypted in CBC mode 35

  34. CFB mode IV encrypt Ciphertext stream Plaintext stream  Self-synchronizing 36

  35. Stream Ciphers and OFB mode Stream Generator IV encrypt Pseudo Random Key stream Plaintext stream Ciphertext stream 37

  36. Stream ciphers  Fast and `easy’ in hardware  (Almost) no buffering  No error propagation  Most stream ciphers are confidential  GSM A5/1 -- broken!  Military  Related: Random number generation 39

  37. Cryptography Basics Part 3: Algorithms

  38. Modern Block Cipher  Principle: Combine n bit plaintext block  Confusion (substitution)  Diffusion (transposition)  Design: Iterate a round encrypt decrypt function  Two different types: n bit ciphertext block  Feistel network (e.g. DES)  Substitution-permutation network (e.g. AES) 41

  39. One Feistel round Li Ri Round Function Fi Li+1 Ri+1 42

  40. DES  Data Encryption Standard  published by NIST as FIPS PUB 46 in 1977  Based on Lucifer by IBM  NSA changed the design  Fear of weaknesses  Used extensively by banks  E.g. ATM  With whitening in Win2K encrypted FS  Becoming less common (move towards AES) 43

  41. DES properties  Block size 64 bit  Key size 64 bit  56 bit real key data  Remaining 8 bits are parity bits  16 rounds Feistel network  Complement property:  E (k,x c ) = E(kc,x) c 44

  42. One Feistel round 64 bit block split into 2x32 bits L i R i F (selected from the 56 key bits) S S 48 bit “round key” E S S P S K i S S S Exclusive OR P Permutation E Expansion L i+1 R i+1 45

  43. DES Round function (F) 32 expansion 48 Round key Ki 48 6 to 4 6 to 4 6 to 4 6 to 4 6 to 4 6 to 4 6 to 4 6 to 4 S-box S-box S-box S-box S-box S-box S-box S-box 32 permutation 46

  44. Key-schedule Ci-1 (28 bit) Di-1 (28 bit) Permuted shift by 1 or 2 choice (depends on i) Ki PC2 48 bits Ci (28 bit) Di (28 bit) 47

  45. DES: discussion  Extensively studied  No severe weaknesses found  However, 56 bit key too short  3DES  AES as new standard 48

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend