80 likes | 220 Views
CSE 331: Introduction to Networks and Security. Encrypted Knock Knock. Fall 2001 Instructor: Carl A. Gunter. ElGamal. Similar to Diffie-Hellman, but provides for encryption of a message M. Start as with Diffie-Hellman. Select and share the public information
E N D
CSE 331: Introduction to Networks and Security Encrypted Knock Knock Fall 2001 Instructor: Carl A. Gunter
ElGamal • Similar to Diffie-Hellman, but provides for encryption of a message M. • Start as with Diffie-Hellman. • Select and share the public information • Select a prime number q and a primitive root of this prime. • Compute the private and public keys. • Alice chooses XA < q at random and takes YA to be **XA mod q. • Bob chooses XB < q at random and takes YB to be **XB mod q.
ElGamal Encryption • Alice wishes to send the encryption of a message M to Bob. • Represent M as a number M < q. • Choose random r such that 1<=r<q. • Let R = YB**r mod q. • Let = **r mod q. • Let = R*M mod q. • The encrypted message is (, ).
ElGamal Decryption • To decrypt: • **XB = (**r)**XB = (**XB)**r = (YB)**r R (mod q) • *R-1 = (R*M)*R-1 M (mod q)
EKK • Encrypted Knock! Knock! (EKK) uses ElGamal and DES. • It provides confidential channels without authentication. • Protocol notation: • Alice -> Bob: How are you? • Bob -> Alice: Ok, and you? • Alice -> Bob: Not bad, have a nice day! • Bob -> Alice: You too!
EKK Set Up • Advanced setup: prime q and primitive root where q is more than 64 bits. • Client C (you) and server S select key pairs (XC, YC) and (XS, YS) as in ElGamal/Diffie-Hellman.
EKK Overview • Client initiates protocol with “Knock! Knock!” message and its public key YC. • Server responds with “Who’s there?”, its public key YS, and DES key K, encrypted using ElGamal. • Client responds with first part of joke encrypted using DES and key K. • Server plays along, using DES encryption with K.
EKK Example • C->S: Knock! Knock! YC. • S->C: Who’s there? YS, (, ). • C->S: E(K, Boo!). • S->C: E(K, Boo! Who?). • C->S: E(K, Don’t cry, this will be easy!). • S->C: E(K, Don’t waste server time, connection closed.).