1 / 11

CSC 386 – Computer Security

CSC 386 – Computer Security. Scott Heggen. Agenda. Exploring that locked box thing from Friday?. Rivest , Shamar, and Adleman (RSA). A public key encryption method Based on the fact that computers have trouble factoring large prime numbers

kai-hunt
Download Presentation

CSC 386 – Computer 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. CSC 386 – Computer Security Scott Heggen

  2. Agenda • Exploring that locked box thing from Friday?

  3. Rivest, Shamar, and Adleman (RSA) • A public key encryption method • Based on the fact that computers have trouble factoring large prime numbers • Used extensively in many systems and protocols, such as SSH

  4. RSA • Step 1: • Convert your text to numerical values. • Usually this step is inherent, as everything is already represented as a number • For this example, we will simplify things by assuming • A = 1 • B = 2 • C = 3 • …

  5. RSA • Step 2: • Generate a pair of keys: • Pick 2 very large random numbers • p = 3 • q = 11 • Compute the product: • n = 3 x 11 = 33 • φ(n) = (p-1) × (q-1) = 2 × 10 = 20 • Select a number less than φ(n), and relatively prime (few factors) • e = 7 With very large values of p and q, n is extremely difficult for a computer to reverse! Public key!

  6. p = 3 q = 11 φ(n) = 20 n = 33 e = 7 RSA • Compute the matching private key d, as the inverse of e mod φ(n): • d = inv of e mod φ(n) = inv(7) mod 20 = 3 • 7 x 1 mod 20 = 7 • 7 x 2 mod 20 = 14 • 7 x 3 mod 20 = 1 • Public key (e): (7, 33) • Private key (d): (3, 33) In other words: 7 x ? mod 20 = 1

  7. RSA Alice Bob Public key (e): (7, 33) Private key (d): (3, 33) C Eve

  8. p = 3 q = 11 φ(n) = 20 n = 33 e = 7 d = 3 RSA m = “abc” = 123 • Step 3 (Alice) • Encrypt your message using the public key (e) • C = mkey mod n • For A: • CA = 17 mod 33 = 1 • For B: • CB = 27 mod 33 = 29 • For C: • Cc = 37 mod 33 = 9 C = 1, 29, 9

  9. RSA Alice Bob Public key (e): (7, 33) Private key (d): (3, 33) C Eve knows: C = 1, 29, 9 e = (7, 33) Eve

  10. p = 3 q = 11 n = 33 φ(n) = 20 e = 7 d = 3 RSA C = 1, 29, 9 • Step 4 (Bob) • Decrypt the cipher using the private key (d) • m = Ckey mod n • For A: • mA = 13 mod 33 = 1 • For B: • mB = 293 mod 33 = 2 • For A: • mC = 93 mod 33 = 3 Eve knows: C = 1, 29, 9 e = (7, 33)

  11. Next Class • Quiz on RSA • Be able to encrypt a message given a public key • Be able to decrypt a message given a private key

More Related