1 / 71

COEN 350: Network Security

COEN 350: Network Security. Overview of Cryptography. Overview of Cryptography. Table of contents Introduction Cryptographic Security One Way Functions Secret Key Cryptography Public Key Cryptography Message Authentication Codes Zero Knowledge Proofs Diffie Hellman Key Exchange.

braxton
Download Presentation

COEN 350: Network Security

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. COEN 350: Network Security Overview of Cryptography

  2. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  3. Cryptography • Traditional use of cryptography • Encrypt a plain text into cypher • Only people with the right knowledge can recover plain text. • Secret Key (Symmetric) Cryptography • Encryption and decryption use secret key c. • Public Key (Asymmetric) Cryptography • Encryption and decryption use two different keys.

  4. Cryptography • Other uses of cryptography • Secure data while stored. • Authenticate entities. • Ensure integrity of data. • Sign statements so that signature cannot be repudiated.

  5. Hash Functions • Given an object, create a hash (short bit-string) of the object. • Hashs differ  Objects differ • Objects differ with overwhelming prob. Hashes differ • Cryptographically secure hash: • Given a hash, cannot find object with that hash.

  6. Hash Functions • Tripwire • Protect OS against trojans. • Maintain hashes of all system libraries in a secure area. • Check hash against known hash periodically.

  7. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  8. Cryptographic Security • Leverage in cryptography comes from functions that are hard to computer without special knowledge. • “Hard to compute” difficult to substantiate

  9. Cryptographic Security • “Hard to compute” = NP complete • Problem is P: can be solved deterministically in polynomial time. • Problem is NP: solution can be verified in polynomial time. • Central Conjecture: NP  P. • NP-complete: If this problem can be solved in polynomial time then all NP problems can be solved in polynomial time. • NP-complete problems: Intrinsically difficult problems to solve on a computer. • But: NP completeness is tendency. • Instances of NP-complete problems can be easy to solve. • Knapsack problem.

  10. Cryptographic Security • “Computationally hard” = “Takes n years to solve on best machine.” • Breaking codes is usually parallelizable. Use distributed attack. • SETI@home • Moore’s law: Computers double in speed every 16 months.

  11. Cryptographic Security • UNIX password cracking • UNIX passwords are 8 characters long. • Assume 102 printable characters in a password. • 1016 possible passwords. • 10000 password attempts a second takes 1012/2 seconds to find random password. • 16,000 years to find password • Dictionary attacks take much less.

  12. Cryptographic Security • DES Data encryption standard • Published in 1977 by National Bureau of Standards. • Uses 56 bit key • Brute-Force attack succeeds after ~1016 tries. • 1977: Diffie Hellman: • Spend $20,000,000.- to build parallel machine that can find key in 12 hours. • 1998: Electronic Frontier Association • Build DES cracker for $250,000.- that could break a key in 4 days. • $150,000.- for second cracker

  13. Cryptographic Security • Security of Algorithms • Fundamental Security Paradigm • "If a lot of smart people have tried to crack a paradigm for a long time, then it is impossible to crack the paradigm."

  14. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  15. One-Way Functions • One way function • Easy to compute • Hard to invert. • “Hard” means computationally infeasible.

  16. One-Way Functions • Example • X = {1, 2, ... , 16} • Define f: X → X, x → x3 mod 17. • This function is reasonably easy to compute. • Surprisingly hard to calculate logarithms in a finite field. • Use the following table.

  17. One-Way Functions • Preimage resistance: • Given a possible image y, it is computationally impossible to find any preimage x such that f (x) = y. • Second preimage resistance: • Given a pre-image x, it is computationally infeasible to find another preimage z, z  x, such that f (x) = f (y).

  18. One-Way Functions • Collision resistant: • It is computationally infeasible to find any two distincts inputs x, x', x'  x such that f(x) = f(x').

  19. One-Way Functions Definition: A function f is a strong one-way hash function (also known as a collision resistant (one-way) hash function) if and only if • f is easily computable, that is, given x, it is easy to calculate f(x). • f is preimage resistant. • f is second preimage resistant. • f is collision resistant.

  20. One-Way Functions • One-Way function with trapdoors • Much in cryptography is based on being able to do a difficult thing when possessing a secret. • There are one-way functions that are easy to invert if one knows a secret.

  21. One-Way Functions • Choose • p = 48611(a prime) • q = 53993 (a prime) • n = p·q. • Define f • f (x) = x 3 mod n. • f is one way, if we only know n. • If we know the secret that n = pq, then there is an algorithm that solves x 3 = y mod n for given y and unknown x.

  22. One-Way Functions • One-way function with trapdoor • Family of functions fiwhere i  I, an index set. • Each fi is one-way. • There exists functions hi and a secret s such that • hi (s, .) is easy to compute • fi (hi (s, y)) = y. • That is, hi (s, .) is the inverse function of fi

  23. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  24. Secret Key Cryptography • Conventional encryption uses a secret to convert plaintext to cipher and the same secret to convert cipher to plaintext. • A Greek general tattoos the message into the crown of the head of a slave who then lets his hair grow again. When the slave reaches the destination, the recipient reads the message after the slave has shaven his head again. • One-time pad • Caesar’s cypher

  25. Secret Key Cryptography • Encryption uses an algorithm publicly known. • Sender and receiver use a key.

  26. Secret Key Cryptography • Generic recipe: • Take the plain text. • Apply a transformation (based on secret, reversible with secret). • Repeat until result is sufficiently disguised • Product cipher • Use first one transformation, then another one.

  27. Secret Key Cryptography • Substitution Permutation Network • Each state involves substitutions and permutations. • Substitutions: • Take an input, replace it by an output. • Often implemented as a table. • Input needs to be small.

  28. Secret Key Cryptography • Permutations • Take the bits and reorder them.

  29. Secret Key Cryptography • Substitution Permutation Network • Encode from top to bottom • Decode from bottom to top

  30. Secret Key Cryptography • Iterated block cipher • Made up of rounds. • In each round, apply an transformation with a separate key (the round key). • Feistel Cipher

  31. Secret Key Cryptography • Feistel Cipher • Iterated Block cipher • Block size is 2t. • Each round: • Breaks input into left half L(n) and right half R(n) • L(n+1) = R(n). • R(n+1) = Mangler(R(n), Kn)  L(n) • Kn is round key.

  32. Secret Key Cryptography Feistel round for encryption (left) and decryption (right)

  33. Secret Key Cryptography • DES (1977) • uses a 64b key with a parity check, so that effective key size is 56b. • Derives 16 round keys of 48b each. • Works on input of size 64. • Uses 16 round Feistel algorithm • IDEA (1991) • Uses a 128b key • Uses 8 computationally identical rounds based on generalized Feistel algorithm • Additional beginning and ending transformation.

  34. Secret Key Cryptography • Typical block code takes 64b plaintext and changes it to 64b cipher text. • Electronic Code Book: • Break plain text into 64b-blocks. • Encrypt all blocks. • Vulnerable to attacks • Two identical text blocks are encrypted the same way. • Allows guessing contents. • Reordering of plain text = Reordering of cipher text. • Change meaning of cipher text.

  35. Secret Key Cryptography • Example: • Database contains employee and salary information. • Encrypted:

  36. Secret Key Cryptography • Switch portion of cipher text • Resulting plaintext

  37. Secret Key Cryptography Cipher Block Chaining Encryption and Decryption

  38. Secret Key Cryptography • Cipher Block Chaining • If we do not mind to mangle some preceding data, we can switch bits. • How? Your turn.

  39. Secret Key Cryptography • Output Feedback modes • Same idea, but prevents these types of attacks. Output Feed Back Cipher Feed Back

  40. Secret Key Cryptography • One-Time Pad • Only proven secure cryptographic method • But the pad needs to be transmitted between sender and receiver. • XORing with a short string is not secure. • See projects

  41. Secret Key Cryptography • Message Authentication Code • Can be calculated with cipher block chaining or similar method. • c6 is the MAC

  42. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  43. Public Key Cryptography • Asymmetric Key Cryptograpy. • Use one key for encryption, another for decryption. • E(e,.) encryption with key e • D(d,.) is decryption with key d • D(d,E(e,m)) = E(e,D(d,m)) = m for all messages m.

  44. Public Key Cryptography • Keep one key public, the other one private. • Use public key to encrypt, give Bob secret key to decrypt.

  45. Public Key Cryptography • Signing Messages. • Alice creates a public key pair (e,d) and gives or publishes e. • Alice uses private key to calculate s = D(d,m) • Pad with zeroes if necessary. • Bob uses Alice's public key to decrypt E(e,s) = E(e,D(d,m')) = m. • If m is in the format that a signed message has, then Bob accepts the message as truly Alice's.

  46. Public Key CryptographyRSA • RSA: Rivest Shamir Adleman • Choose n = pq, p, q large primes • Select e that is coprime to  (n)=(p-1)(q-1) • Find d such that e d = 1 mod (n). • Only computationally feasible if n = pq is known. • Public key: (e,n) • Private key: (d,n)

  47. Public Key CryptographyRSA • Encryption with private key. • Divide messages into chunks < n • Encrypt chunk c as c1 = cemod n. • Decryption • Calculate c = c1d mod n. • c1d = (ce)d= ced = cx(n)+1 = c • Using Euler’s theorem • a(n)= 1 mod n.

  48. Public Key Cryptography • RSA is safe if used with caution.

  49. Overview of Cryptography Table of contents • Introduction • Cryptographic Security • One Way Functions • Secret Key Cryptography • Public Key Cryptography • Message Authentication Codes • Zero Knowledge Proofs • Diffie Hellman Key Exchange

  50. Message Authentication Code • Also known as MIC (Message Integrity Code). • Append MAC to message. • Nobody can change message without changing MAC. • Easy to check whether MAC belongs to the message.

More Related