Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 386 – Computer Security Scott Heggen. Agenda Exploring that locked box thing from Friday?

Similar presentations


Presentation on theme: "CSC 386 – Computer Security Scott Heggen. Agenda Exploring that locked box thing from Friday?"— 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 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) p = 3 q = 11 φ(n) = 20 n = 33 e = 7 In other words: 7 x ? mod 20 = 1

7 RSA AliceBob C Eve Public key (e): (7, 33) Private key (d): (3, 33)

8 RSA Step 3 (Alice) Encrypt your message using the public key (e) C = m key mod n For A: C A = 1 7 mod 33 = 1 For B: C B = 2 7 mod 33 = 29 For C: C c = 3 7 mod 33 = 9 p = 3 q = 11 φ(n) = 20 n = 33 e = 7 d = 3 m = “abc” = 123 C = 1, 29, 9

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

10 RSA Step 4 (Bob) Decrypt the cipher using the private key (d) m = C key mod n For A: m A = 1 3 mod 33 = 1 For B: m B = 29 3 mod 33 = 2 For A: m C = 9 3 mod 33 = 3 p = 3 q = 11 n = 33 φ(n) = 20 e = 7 d = 3 C = 1, 29, 9 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


Download ppt "CSC 386 – Computer Security Scott Heggen. Agenda Exploring that locked box thing from Friday?"

Similar presentations


Ads by Google