CS338 Computer Security Friday, 4 October 2024 + Monday - Exam prep (exam is on Friday, Oct 11) - ?Doing some of this stuff with openssl - ?Walkthrough of TLS handshake + Lab: Digital Signatures + Problem: Key Exchange - A & B want a shared secret from which they can make a symmetric encryption key - A & B don't want Eve to read their messages - Solution: Diffie-Hellman + Problem: Diffie-Hellman & AITM - Mal can pretend to be Bob when Alice initiates contact - Mal can (optionally) also pretend to be Alice to get info from Bob - Solution: public-key infrastructure (PKI), certificates + Certificate-based story outline Alice/"Bob" do Diffie-Hellman --> shared secret S Alice/"Bob" convert S to AES key K "Bob" sends Alice a certificate that says: "Bob uses RSA public key (n_b,e_b)" Alice checks to make sure a Trusted Third Party has signed the certificate ** if it's legit, Alice now believes that the real Bob uses (n_b,e_b) as a public key ** but is "Bob" the real Bob? Alice sends "Bob" a challenge X: prove to me you have the secret/private key (n_b,d_b) that goes with the public key (n_b,e_b) by encrypting X with (n_b,d_b) "Bob" sends his response to the challenge Alice checks the response for validity Challenge passed? Then Alice believes she's talking to the real Bob, so now Alice and Bob now freely communicate encrypting with AES key K + What from this story do we already know how to do? + What from this story do we *not* know how to do? + General notations we'll use for cryptography H(M) -- a hash of a message M AES(K,M) -- AES encryption of a message M with key K AES_D(K,C) -- AES decryption of ciphertext C with key K Given a public/private key pair (P, S): E(P, M) -- encryption of a message M with public key P E(S, M) -- encryption of a message M with secret key P The verbs "encrypt" and "decrypt" are a little slippery with public-key cryptography, since you can "encrypt" with either P or S. E(S, E(P, M)) == M E(P, E(S, M)) == M What is E in RSA? Suppose P = (n,e) and S = (n,d) E(P, M) = M^e mod n E(S, M) = M^d mod n ---- Know or can skip for now - DH - [can skip] secret-to-key algorithm - How to generate a random challenge x - How to encrypt x using the secret key (n_b,d_b) - How to check that the encrypted x was encrypted with (n_b,d_b) - How to encrypt with AES Don't know - What does a signed certificate consist of? - What is a signature? - How does Alice check the signature?