Topics Covered: Intro Cryptography, Digital Signature, TLS
The basic idea of internet security is to ensure that only the sender and receiver can read and write messages to each other. No third-party is able to hijack their secure connection by intercepting or spoofing messages.
The basic goal of the asynmmetric cryptography field is to come up with "keys" belonging to the sender and the receiver such that
where and are the sender and receiver respectively and is the message. encrypts the message, and decrypts it.
Symmetric encryption is usually faster, and you only generate one key. Why don't we use it?
Say we choose to use it. How do we generate it? Maybe the sender can generate it and share it with the receiver. But how do we get it to the receiver when we don't have a secure connection set up? We can't encrypt it, because the receiver can't decrypt it yet.
In this form of asymmetric encryption, both and must create a private key and , as well as a public key which they will share with each other. Both will create their own public keys and share them with each other, but we focus on one of them only for our examples. does not know 's private key, and vice versa. Two requirements need to be fulfilled:
The important part about RSA is that .
The lecture 9 slides offer the exchange in writing. I'll try writing it down symbolically for anyone that found the slide as confusing as I did.
The digital signature is a hashed session key, signed by the private key. So in our above terminology, let be a hash function satisfying the basic ideas of a hash function
Why does this guarantee that came from our connection? Let's say sends this signature along with the signature (and message) to . can use the public key . If hashes , they should obtain , meaning was not altered, and it comes from .
TLS (Transport Layer Security) uses symmetric key crypto, and ensures integrity using MAC (Message Authentication Checksum). Receiver checks the MAC and the associated data as it arrives. It functions similarly to the digital signature, where a key is shared between sender and receiver, and the tag is generated using this key and a hash function. A few notes:
TLS Protocol:
Sender:
Receiver:
From Cloudflare Blog,
A TLS certificate is issued by a certificate authority to the person or business that owns a domain. The certificate contains important information about who owns the domain, along with the server's public key, both of which are important for validating the server's identity.
Servers adhering to HTTPS are using TLS with HTTP, and are run usually on port 443.
For extra reference material, here is the TCP handshake modified to include TLS exchange. The client provides the server with what hash functions and ciphers it can use, the server will choose which they will use and send the client the certificate, which the client will verify. The session keys are either determined by a random number (as in example above) or using Diffie Hellman, which is described in depth on the lecture 9 slides.