17
A E D C B # Symmetric Keys = n*(n-1)/2 F 1 2 3 4 5 6 7 8 9 . . .

A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Embed Size (px)

Citation preview

Page 1: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

AA

EE

DD

CC

BB

# Symmetric Keys = n*(n-1)/2

FF

1

2345

67 8

9 . . .

Page 2: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

AA

EE

DD

CC

BB

# Symmetric Keys = n*(n-1)/2

# Public/Private Keys = 2n

FF

1

1111

22

2 22 . . .

Page 3: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

RSA

• Chose two random large prime numbers p & q (of equal length is best)

• Compute their product n = pq

• Randomly choose an encryption key e :e and (p-1)(q-1) are relatively prime (gcd=1)

• Calculate the decryption key d :d = e-1 mod ((p-1)(q-1))

3

Page 4: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

RSA encryption

Split up the message into blocks less than n

ci = mie mod n

Decryption is similar

di = cid mod n

4

Page 5: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

RSA Example

p=47 , q=71, n=pq=3337

Choose e : no factors common with (p-1)(q-1) = 46*70 = 3220

Randomly choose e to be 79

Then d=79-1 mod 3220 = 1019

5

Page 6: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

RSA Example (cont)

• Encrypt m=6882326879666683• Break it up into blocks688 232 687 966 668 003 m1 m2 m3 m4 m5 m6

• Encrypt:68879 mod 3337 = 1570 = c1

• Decrypt:15701019 mod 3337 = 688 = m1

6

Page 7: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Symmetric Key Signatures1 Alice uses kA to encrypt the document going to Bob and sends it to Trent

2 Trent decrypts the document with kA

3 Trent appends a statement that he received it from Alice

4 Trent encrypts the bundle with kB

5 Trent sends the encrypted bundle to Bob

6 Bob decrypts the bundle with kB , and can read the message and Trent’s certification

7

Page 8: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Public Key Signatures

8

1 Alice encrypts the document with her private key2 Alice sends the encrypted (signed) document to Bob3 Bob decrypts the document with Alice’s public key

Page 9: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Cryptographic Hashes

9

Page 10: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Public Key Signature w/ Timestamp

10

1 Alice adds a timestamp to the document2 Alice encrypts the document with her private key3 Alice sends the encrypted (signed) document to Bob4 Bob takes the check to the bank5 Bank decrypts the document with Alice’s public key6 Bank stores the check information and the timestamp in a database7 If Bob tries to deposit the check again, its information will match the database

Page 11: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Multiple Signatures

11

1 Alice signs a hash of the document2 Bob signs a hash of the document3 Bob sends his signature to Alice4 Alice sends the document, her signature, and Bob’s signature to Carol5 Carol can verify both signatures

Page 12: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Digital Signatures and Encryption

12

1 Alice signs the message with her private key2 Alice encrypts the signed message with Bob’s public key and sends it to Bob3 Bob decrypts the message with his private key4 Bob verifies with Alice’s public key and recovers the message

Page 13: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Digital Signatures and Encryptiontypical notation

13

Alice Bob

SA (M)

EB (SA (M) )

DB (EB (SA (M))) = SA(M)

VA (SA (M)) = M

Page 14: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

Needham-Schroeder Protocol

14

Page 15: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

MITM Attack on N-S

15

Page 16: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

The Fix

16

Page 17: A A E E D D C C B B # Symmetric Keys = n*(n-1)/2 F F 1 2 3 4 5 6 7 8 9

17

SSL