Lecture 9: Modern Encryption: Key Concepts
Overview
Robert Townsend's lecture introduces modern encryption concepts, starting with the distinction between encryption and distributed ledgers. He explains public/private key cryptography, hash functions (like SHA-256), and cryptographic puzzles, using analogies like prime number factorization. The lecture delves into cyclic rings and the ElGamal encryption scheme, detailing key generation, encryption, and decryption processes. It also covers digital signatures (Schnorr scheme), polynomial-based encryption for quantum resistance, homomorphic encryption, multi-party computation, and zero-knowledge proofs, illustrating their applications with examples like Bitcoin's Merkle trees and Pedersen commitments.
Key takeaways
- Public key cryptography, exemplified by ElGamal, uses a public key for encryption and a private key for decryption, relying on the difficulty of problems like discrete logarithms.
- Hash functions provide data integrity and act as digital signatures; their one-way nature and avalanche effect are critical properties.
- Modern encryption techniques like polynomial-based methods are being developed to resist quantum computing threats.
- Homomorphic encryption allows computations on encrypted data, while multi-party computation enables collaborative computation on private data.
- Zero-knowledge proofs allow a prover to convince a verifier of knowledge without revealing the knowledge itself, crucial for privacy in transactions.
- Bitcoin utilizes Merkle trees for transaction integrity and proof-of-work (via a nonce and double-hashing) to secure its ledger and determine block validators.
Chapters
- Encryption is a tool separate from ledgers and smart contracts.
- Key concepts: encoded message systems, hashes, cryptographic puzzles.
- Modern encryption uses public/private keys and cyclic rings.
- Covers FHE, multiparty computation, and zero-knowledge proofs.
- Encryption enhances validation protocols for ledgers and smart contracts.
- Enables secure alteration of financial counts and transfers.
- Creates immutable and readily indexed records without trust.
- Addresses obstacles to trade: private info, limited communication, confidential data.
- Public key encrypts messages into ciphertext; private key decrypts.
- Algorithms make deciphering without the private key virtually impossible.
- Analogy: factoring a large product of two large prime numbers.
- Private key is like one of the factors, easier to verify with.
- Cryptographic hash function takes arbitrary input to fixed-size output (hash).
- Properties: same input yields same hash; hard to decipher hash to original input (one-way).
- Single bit change in input causes significant, unpredictable output change (avalanche effect).
- Hard to find two different inputs producing the same hash.
- Hashes act as signatures for messages and data sets.
- Hashing allows verification of data integrity against corruption or alteration.
- Analogy: sealing a document with a product of primes.
- Author commits to authorship by stamping data with a hash.
- Puzzles are hard to solve but controllable in difficulty (trial and error).
- Prime number factorization is computationally hard (exponential complexity).
- Verification of a factorization is computationally easy (polynomial complexity).
- RSA encryption relies on the difficulty of factoring large integers.
- Pre-Diffie, same key scrambled and unscrambled messages.
- Key machines were valuable targets (e.g., WWII Enigma).
- Diffie's design uses public keys for encryption and private keys for decryption.
- Most elements (keys, algorithms) are public, only the private key is secret.
- A ring is a set with associative, commutative addition and distributive multiplication.
- Zn (integers modulo n) is a finite ring where sums wrap around using remainders.
- A generator of a group G, when successively multiplied, generates the entire space.
- Cyclic rings are formed using a generator and a modulus.
- Group order is 11, elements include 0.
- Generator is 6; successive powers (mod 11) generate the group elements.
- Example: 6^1 mod 11 = 6, 6^2 mod 11 = 36 mod 11 = 3.
- This structure is one-to-one, allowing deciphering if the code is known.
- ElGamal relies on the difficulty of the discrete logarithm problem in cyclic groups.
- Crucial for the cyclic group to have a very large order to prevent brute-force attacks (baby-step giant-step).
- Private key (r) is a random integer; public key (h) is g^r mod p.
- Public parameters: group G, order q, generator g, modulus p.
- Alice generates key pair (private x, public h=g^x).
- Bob maps message m to space G.
- Bob chooses random y, computes shared secret s = h^y = (g^x)^y = g^xy.
- Bob sends ciphertexts (g^y, m*s) to Alice.
- Alice uses her private key x to compute g^(xy) from Bob's first ciphertext (g^y).
- This g^(xy) is the shared secret s.
- Alice computes s inverse and multiplies it with Bob's second ciphertext (m*s).
- Result: (m*s) * s^-1 = m, recovering the original message.
- Private keys generate signatures for outgoing messages.
- Public keys verify the signer's identity and message integrity (authentication, non-repudiation, integrity).
- Schnorr signature scheme involves parameter generation, key generation, signing, and verification.
- Parameters: N-bit prime p, hash function H, generator g for cyclic group modulo q.
- Alice's private key is 'a', public key is g^a mod p.
- Signing: Alice picks random k, computes h=g^k mod p.
- Alice computes s = (a*c + k) mod q, where c is derived from message and h.
- Bob verifies by checking if g^s equals (g^a)^c * h mod p.
Transcript excerpt
0:00 [SQUEAKING] [RUSTLING] [CLICKING] ROBERT TOWNSEND: This is lecture 9 on encryption. Be prepared. There's a bit of math in this, but the main goal is the conceptualization of the problem. So we've got encryption is a tool in and of itself, and it can, therefore, be separated from the ledgers and so on. I have a slide on that. And then we'll come to three interrelated concepts, encoded message systems, hashes, and cryptographic puzzles.
0:54 And then I'll circle back to modern encryption, which uses public and private keys, giving you example of cyclic rings. And then we'll go into fully homomorphic encryption, multiparty computation, and zero-knowledge proofs in terms of what they are and some notation. I have been threatening to go back periodically to Bitcoin, which keeps popping up in various of the lectures. In this case, we'll now hopefully have enough of the tools to understand the data storage system in so-called Merkle trees, or hashed trees associated with Bitcoin
1:43 and the use of proof-of-work algorithm to randomize who is the validator. And finally, I'll summarize how these FHE, Fully Homomorphic Encryption, multiparty computation, and zero-knowledge proofs fit together in terms of when they are needed or not. So the point of this slide is something I mentioned last time, that programmed contracts are distinct from distributed ledgers. We can use encryption for both, and it's the third leg, in the sense, that we've covered already, distributed ledgers and smart contracts. Encryption can be used as part of the validation protocol.
2:34 Validation of the ledgers allows the financial counts to be altered with transfers of money and assets, but done in a secure way because it will be encrypted, hence, no trust is necessary, and this will create immutable and readily indexed records. So that's the ledger part of it.
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, MIT OpenCourseWare.