Latest / CyberSecurity Summary / Introduction to Modern Cryptography: Third Edition (Chapman & Hall/CRC Cryptography and Network Security Series)
Transcript
- 0:00Speaker 1: Hey, there, curious minds.
- 0:01Speaker 2: Every time you send a secure message, log into your bank,
- 0:03Speaker 2: or even you know, just see that little padlock on
- 0:05Speaker 2: a website, there's this whole complex thing happening behind the scenes.
- 0:08Speaker 1: It's not magic.
- 0:09Speaker 2: It's this fascinating world built on really clever math, sophisticated codes,
- 0:15Speaker 2: and it's constantly changing to keep our digital stuff safe. Today,
- 0:18Speaker 2: we're taking a deep dive into modern cryptography. We'll look
- 0:21Speaker 2: at where it came from, how it works now, and
- 0:23Speaker 2: crucially the big challenges ahead like quantum computing. Our guide
- 0:29Speaker 2: is Introduction to Modern Cryptography, third edition by Jonathan Katz.
- 0:33Speaker 2: It's pretty rigorous, but honestly surprisingly easy to follow on
- 0:37Speaker 2: a lot of this stuff. Our mission, as always, is
- 0:39Speaker 2: to give you that shortcut to being really well informed.
- 0:42Speaker 2: We want to pull out the key ideas, the surprising
- 0:44Speaker 2: bits that make up our digital security.
- 0:46Speaker 1: Okay, let's unpack this.
- 0:47Speaker 2: Let's start way back the old school stuff, classical cryptography
- 0:51Speaker 2: ciphers like Visionnaire, maybe trying to hide pattern, Yeah exactly,
- 0:55Speaker 2: But what was the big weakness there? Why didn't that last? Well?
- 0:59Speaker 3: The fundamental issue with those older schemes, and it's why
- 1:01Speaker 3: we often call it an art back then was this
- 1:04Speaker 3: reliance on security by obscurity.
- 1:07Speaker 1: Just keep the method secret, right.
- 1:09Speaker 3: The thinking was, if nobody knows how you're encrypting, you're safe.
- 1:13Speaker 3: But that just doesn't hold up with visionnaire. For instance,
- 1:16Speaker 3: even basic statistical tools like calculating the index of coincidence.
- 1:22Speaker 3: It basically measures letter frequencies that can reveal patterns. For
- 1:26Speaker 3: English text, that index is around point zero six y five.
- 1:29Speaker 3: If you analyze cipher text, then it's close to that
- 1:32Speaker 3: something's up. And even simpler if an attacker could just
- 1:35Speaker 3: guess a tiny bit of the original message like dear sir.
- 1:38Speaker 1: Maybe a known plaintext attack.
- 1:40Speaker 3: Exactly, those basic shift substitution Visionaire ciphers, they become well,
- 1:45Speaker 3: the book calls them trivial to break.
- 1:46Speaker 2: Okay, So that leads right into Kirkhoff's principle, doesn't it.
- 1:49Speaker 2: It sounds backward, But why is keeping the algorithm secret
- 1:53Speaker 2: actually a bad idea?
- 1:54Speaker 3: Precisely, Kirkhoff said way back that the security should only
- 1:59Speaker 3: depend on the key being secret, not the method. Proprietary
- 2:03Speaker 3: sort of home brewed algorithms are dangerous because they haven't
- 2:06Speaker 3: been hammered on.
- 2:07Speaker 2: By experts, no public scrutiny, and.
- 2:10Speaker 3: History is littered with disastrous results from ignoring this. Think
- 2:16Speaker 3: early DRM, some Wi Fi security. They just crumbled once
- 2:19Speaker 3: someone reverse engineered the secret sauce and found it was
- 2:22Speaker 3: well weak. Our confidence in something like as comes to
- 2:25Speaker 3: the fact that it's been extensively studied by experts for
- 2:28Speaker 3: decades and it's held up.
- 2:30Speaker 2: So the art was obscurity and tricks. How did we
- 2:32Speaker 2: get to the science of modern crypto? What changed?
- 2:35Speaker 3: It was a fundamental shift really kicking off around the eighties.
- 2:38Speaker 3: Modern crypto was built on three pillars. First, formal definitions.
- 2:42Speaker 3: You have to define exactly what secure means for your
- 2:44Speaker 3: specific goal, Like the book says, if you don't know
- 2:47Speaker 3: what it is you are trying to achieve, how can
- 2:49Speaker 3: you hope to know when you have achieved?
- 2:51Speaker 2: It makes sense, right, Yeah, absolutely define the target.
- 2:54Speaker 3: Second, precise assumptions we state explicitly. Okay, this system is
- 3:00Speaker 3: if this specific math problem is hard to solve, like
- 3:03Speaker 3: factoring large numbers for example. And Third, rigorous proofs mathematical
- 3:08Speaker 3: proofs that show the scheme meets the definition, assuming the
- 3:11Speaker 3: underlying problem is hard.
- 3:12Speaker 2: So it's not just hoping it's secure, it's a proof
- 3:15Speaker 2: like an ironclad guarantee almost that's.
- 3:18Speaker 3: The phrase the book uses. Yeah, proofs of security given
- 3:20Speaker 3: ironclad guarantee, but crucially relative to the definition and the assumptions.
- 3:25Speaker 1: Okay, caveats apply exactly.
- 3:28Speaker 3: It shifts crypto from an art to a science. Real
- 3:31Speaker 3: world implementations can still mess things up, or maybe an
- 3:34Speaker 3: assumption turns out to be wrong someday, but it provides
- 3:37Speaker 3: a framework, as the source puts it, provable security helps
- 3:40Speaker 3: shift the odds in the defender's favor. It gives us
- 3:43Speaker 3: real confidence in the core algorithms.
- 3:44Speaker 2: Okay, let's move into symmetric key crypto private key. This
- 3:48Speaker 2: is where Alice and Bob share the same secret key, right,
- 3:51Speaker 2: that's the one.
- 3:52Speaker 3: Formerly you've got three bits Jen to generate the key
- 3:55Speaker 3: into encrypt using the key, and d to decrypt using
- 3:58Speaker 3: that same key and the basic proper But he's just
- 4:00Speaker 3: deckangam encrypt and decrypt with the same key. You get
- 4:04Speaker 3: your original message.
- 4:04Speaker 2: Genback.
- 4:05Speaker 3: Simple concept.
- 4:06Speaker 2: Now you hear about perfect secrecy sounds like the ultimate goal, Right,
- 4:10Speaker 2: what does that actually mean? Why don't we just use
- 4:12Speaker 2: it for everything?
- 4:12Speaker 3: Perfect secrecy, like the one time pad, is the theoretical peak.
- 4:17Speaker 3: It's secure even if the attacker has infinite computing power.
- 4:21Speaker 1: Wow, infinite.
- 4:22Speaker 3: Yeah, the encrypted message gives zero information about the original
- 4:26Speaker 3: It looks like pure random noise. But and this is
- 4:29Speaker 3: the huge practical catch. The key has to be truly random,
- 4:32Speaker 3: just as long as the message, and you can only
- 4:34Speaker 3: use it once.
- 4:35Speaker 2: H So sending a movie would need a movie sized
- 4:39Speaker 2: key used once exactly.
- 4:41Speaker 3: Imagine securely exchanging that massive single use key. First, it's
- 4:44Speaker 3: just not practical for email or web browsing.
- 4:47Speaker 2: So how do we handle that for everyday stuff? If
- 4:49Speaker 2: the one time pad is out? Yea.
- 4:51Speaker 3: We move to computationally secure encryption. We assume attackers have
- 4:56Speaker 3: limited computing power, still powerful.
- 4:59Speaker 2: But not infinite, a more realistic assumption definitely, And this
- 5:03Speaker 2: lets us use reusable keys.
- 5:05Speaker 3: That are much shorter than the messages. We use tools
- 5:09Speaker 3: like pseudorandom generators prgs to stretch a short random seed
- 5:13Speaker 3: into a long string that looks random to computers okay,
- 5:16Speaker 3: and pseudorandom functions PRFs, which act like random functions. These
- 5:20Speaker 3: are the building blocks. Then, for encrypting actual data, we
- 5:23Speaker 3: use things called modes of operation with block ciphers like
- 5:26Speaker 3: aes CTR mode for instance, lets you encrypt parts of
- 5:30Speaker 3: a message in parallel, which is way faster speeds things up.
- 5:33Speaker 3: Absolutely essential for performance and underpinning all this is the
- 5:37Speaker 3: need for good randomness sources, high entropy data from things
- 5:39Speaker 3: like network timings, your keystrokes, even tiny fluctuations in hardware temperature.
- 5:44Speaker 3: Got to get those initial random seeds right.
- 5:46Speaker 2: We've focused a lot on secrecy keeping things private. Is
- 5:50Speaker 2: that the whole story for digital security not even closed.
- 5:52Speaker 3: This is a really important point. Encryption by itself usually
- 5:55Speaker 3: doesn't guarantee message integrity.
- 5:57Speaker 2: Meaning someone could mess with the message even if they
- 6:00Speaker 2: can't read it precisely.
- 6:01Speaker 3: An active attacker, someone sitting in the middle might be
- 6:05Speaker 3: able to flip bits in the ciphertext. They don't know
- 6:07Speaker 3: what they're changing maybe, but when it gets decrypted it
- 6:10Speaker 3: could be.
- 6:10Speaker 2: Completely different, like changing a dollar amount in a bank transfer.
- 6:13Speaker 3: Exactly that scenario. The encrypted one hundred dollars gets subtly
- 6:17Speaker 3: changed and the bank decrypts it as the thousand dollars.
- 6:21Speaker 3: Encryption didn't stop that.
- 6:22Speaker 2: Okay, that's yeah, that's bad. So how do we make
- 6:25Speaker 2: sure the message wasn't altered, that it's authentic.
- 6:29Speaker 3: That's where MAA keys come in message authentication codes. You
- 6:33Speaker 3: need another shared secret key separate from the encryption key.
- 6:36Speaker 3: Usually with this maat key, the sender calculates a short
- 6:39Speaker 3: cryptographic tag for the.
- 6:41Speaker 2: Message, like a checksum but secure.
- 6:43Speaker 3: Kind of yeah, but much much stronger. The receiver uses
- 6:47Speaker 3: the same maakey to recalculate the tag on the message
- 6:50Speaker 3: they received. If their calculated tag matches the tag that
- 6:54Speaker 3: came with the message, it's authentic.
- 6:55Speaker 1: And if anything changed, the tags won't match exactly.
- 6:59Speaker 3: Even changing one one bit in the message or the
- 7:01Speaker 3: tag will cause verification to fail. HMAC is a really
- 7:05Speaker 3: common standard for this. It provides what's called existential unforgeability
- 7:09Speaker 3: fancy term, but it means an attacker can't create any
- 7:12Speaker 3: valid tag for any new message, even after seeing lots
- 7:15Speaker 3: of legitimate message tag pairs the very strong integrity guarantee.
- 7:19Speaker 1: Okay, MSC's for integrity.
- 7:20Speaker 2: Now. Hash functions, they seem to be everywhere. What makes
- 7:23Speaker 2: a hash function cryptographic? Right?
- 7:25Speaker 3: They are work horses. A cryptographic hash function takes any
- 7:29Speaker 3: input could be tiny, could be huge, and spits out
- 7:32Speaker 3: a fixed size digest a digital fingerprint. The key security
- 7:35Speaker 3: property is collision resistance. It must be incredibly hard computationally
- 7:39Speaker 3: infeasible to find two different inputs that produce the exact
- 7:43Speaker 3: same hash output.
- 7:44Speaker 2: Like finding two people with the same fingerprint, should be
- 7:47Speaker 2: basically impossible.
- 7:48Speaker 3: Ideally, yes, but there's a catch.
- 7:51Speaker 1: Uh I've heard about birthday attacks.
- 7:53Speaker 3: Sounds harmless, It does, but it's a mathematical phenomenon, the
- 7:56Speaker 3: birthday paradox. It means finding any two inputs that collide
- 8:00Speaker 3: is much easier than finding an input that matches a
- 8:02Speaker 3: specific hash output.
- 8:04Speaker 1: Okay, how much easier.
- 8:05Speaker 3: Roughly the square root of the possibilities. So if a
- 8:08Speaker 3: hash has n possible outputs, you only need a bout.
- 8:11Speaker 3: Squirt tries to find a collision for a hash with
- 8:14Speaker 3: l output bits, that's two L two operations.
- 8:17Speaker 2: So for MD five, which is one hundred and twenty
- 8:19Speaker 2: eight bits, that's two sixty.
- 8:20Speaker 3: Four exactly and two sixty four. While big is actually
- 8:23Speaker 3: achievable with modern computing power. That's why MD five is
- 8:27Speaker 3: considered broken. Collisions can be found.
- 8:29Speaker 1: Fast and SAHA one that was used everywhere too.
- 8:32Speaker 3: SAHA one is one hundred and sixty bits, so you're
- 8:33Speaker 3: looking at two hundred and eighty operations for a birthday attack.
- 8:36Speaker 3: Harder but also broken. Now explicit collisions have been demonstrated.
- 8:40Speaker 2: Which is why we use SAHA two fifty six or
- 8:42Speaker 2: even longer hashes.
- 8:44Speaker 3: Now precisely you need that longer output, that larger L
- 8:47Speaker 3: to make the two L two birthday attack computationally infeasible.
- 8:50Speaker 2: Again, okay, so we have symmetric encryption MAACS hashes, but
- 8:54Speaker 2: all the symmetric stuff, the private key stuff, relies on
- 8:57Speaker 2: Alison already having a shared secret key. How do they
- 9:00Speaker 2: get that key in the first place if they've never
- 9:01Speaker 2: met sounds like a chicken and egg problem.
- 9:04Speaker 3: It absolutely was. The book calls it one of the
- 9:06Speaker 3: most important open problems in cryptography before the mid seventies.
- 9:11Speaker 3: Think about it. A network of n people. Each pair
- 9:15Speaker 3: needs a unique key that's roughly n squared.
- 9:18Speaker 1: Keys, which gets huge, fast.
- 9:20Speaker 3: Astronomical for just one thousand users, it's nearly half a
- 9:24Speaker 3: million keys to pre share and manage securely. People tried
- 9:27Speaker 3: using key distribution centers KDCs, trusted servers that would generate
- 9:32Speaker 3: keys for pairs of users, But then.
- 9:34Speaker 1: The KDC is a massive target.
- 9:35Speaker 3: Right exactly, a high value target and a single point
- 9:38Speaker 3: of failure. If the KDC gets hacked, everyone's keys could
- 9:41Speaker 3: be compromised. It was a major bottleneck.
- 9:43Speaker 2: Then Diffy and Hellman came along the public key revolution.
- 9:46Speaker 1: What was the big idea?
- 9:47Speaker 3: It was truly paradigm shifting. They showed how two people
- 9:50Speaker 3: could agree on a shared secret over a public channel,
- 9:53Speaker 3: even if someone is listening to everything.
- 9:55Speaker 2: Like shouting numbers across a crowded room, but ending up
- 9:58Speaker 2: with a secret only you two know.
- 10:00Speaker 3: That's a great analogy. Mathematically, Alice picks a secret X,
- 10:04Speaker 3: Bob picks a secret why there's a public base g
- 10:07Speaker 3: Alice sends gx to Bob, Bob sends gs air y.
- 10:10Speaker 3: Because of exponent rules, they both arrive at the same
- 10:13Speaker 3: value gx y.
- 10:14Speaker 2: An eavesdropper who sees GX and g can't easily figure
- 10:19Speaker 2: out gx correct.
- 10:20Speaker 3: That relies on the presumed hardness of the discrete logarithm
- 10:23Speaker 3: problem or the related computational Diffie Hellman problem. Going from
- 10:27Speaker 3: G and X to gx is easy. Going backwards from
- 10:30Speaker 3: it GX to find x is believed to be incredibly
- 10:34Speaker 3: hard for classical computers.
- 10:35Speaker 1: Mind blowing. But you mentioned a catch earlier.
- 10:38Speaker 3: Ah, Yes, the basic Diffie helmet exchange is completely insecure
- 10:41Speaker 3: against a man in the middle attack.
- 10:42Speaker 1: How does that work?
- 10:43Speaker 3: An attacker Mallory sits between Alice and Bob. Mallory does
- 10:47Speaker 3: a diffie helmet exchange with Alice pretending to be Bob,
- 10:49Speaker 3: and does another one with Bob pretending to be Alice.
- 10:52Speaker 3: Alice and Bob think they have a shared secret, but
- 10:54Speaker 3: they actually share secrets with Mallory, who just decrypts, reads,
- 10:58Speaker 3: possibly modifies, and re encry messages between them.
- 11:01Speaker 1: OUCH.
- 11:01Speaker 2: So you need some way to know you're really talking
- 11:03Speaker 2: to Bob, not Mallory exactly.
- 11:05Speaker 3: You need authentication on top of the basic key exchange, certificates,
- 11:09Speaker 3: pre shared keys, something.
- 11:11Speaker 2: But this idea opened the door to public key encryption
- 11:15Speaker 2: like RSA and digital signatures.
- 11:17Speaker 1: How do those work?
- 11:18Speaker 3: So with public key encryption, you generate a key pair,
- 11:22Speaker 3: a public key you can publish anywhere, and a private
- 11:25Speaker 3: key you guard fiercely. Anyone can use your public key
- 11:29Speaker 3: to encrypt a message for you, but only you with
- 11:32Speaker 3: your private key can decrypt it.
- 11:34Speaker 2: And RSS security comes from.
- 11:35Speaker 3: The difficulty of factoring large numbers. The public key involves
- 11:38Speaker 3: a large number that's the product of two big primes.
- 11:41Speaker 3: Finding those crimes factoring is necessary to get the private
- 11:44Speaker 3: key and that's believed hard digital signatures flip it. You
- 11:48Speaker 3: use your private key to create a signature on a message.
- 11:51Speaker 3: Anyone can use your public key to verify that.
- 11:53Speaker 2: Signature, proving it came from you and wasn't changed.
- 11:56Speaker 3: Yes, it provides authenticity and integrity plus non repudiation. That
- 12:02Speaker 3: means you can't later deny sending the message because only
- 12:05Speaker 3: you have the private key that could create that signature.
- 12:07Speaker 3: It's verifiable by anyone.
- 12:09Speaker 2: Now, I remember hearing public key crypto is way slower
- 12:12Speaker 2: than symmetric stuff.
- 12:13Speaker 1: Is that right?
- 12:13Speaker 3: Oh? Yeah, orders of magnitude slower. Doing math with those
- 12:17Speaker 3: huge numbers is computationally expensive. Encrypting a large file with
- 12:21Speaker 3: RSA directly would be painfully slow.
- 12:23Speaker 1: So how do we use it? In practice?
- 12:25Speaker 3: We use hybrid encryption, often called KEEMDEM key encapsulation data encapsulation.
- 12:30Speaker 1: How does that work?
- 12:32Speaker 3: Use the slow public key crypto only to encrypt and
- 12:35Speaker 3: exchange a temporary random symmetric key, that's the CAM part.
- 12:39Speaker 3: Then use that fast symmetric key with something like AES
- 12:43Speaker 3: to encrypt the actual bulk data. That's the DEM part.
- 12:46Speaker 1: Best of both worlds.
- 12:47Speaker 2: Public key solves the key exchange problem. Symmetric key does
- 12:50Speaker 2: the fast data encryption exactly.
- 12:52Speaker 3: That's how things like TLSSL secure websites work, how PGP
- 12:56Speaker 3: email encryption works. It's the standard approach.
- 12:58Speaker 2: Okay, so V Hellman and RSA, all these public key
- 13:01Speaker 2: systems rely on certain math problems being hard for current computers.
- 13:06Speaker 1: What happens if they become easy?
- 13:08Speaker 3: And that is the multi trillion dollar question right now.
- 13:11Speaker 3: Here's where it gets really interesting and potentially scary. Back
- 13:16Speaker 3: in nineteen ninety four, Peter Shore published an algorithm. Shore's
- 13:20Speaker 3: algorithm shows that a sufficiently powerful quantum computer could solve
- 13:24Speaker 3: both factoring and discrete logarithms efficiently in polynomial time.
- 13:29Speaker 1: Wait, both problems the foundations of RSA and diffy Hellman and.
- 13:33Speaker 3: Elliptic curve cryptography, which is widely.
- 13:35Speaker 2: Used to Yes, so a working quantum computer basically breaks
- 13:39Speaker 2: all the public key crypto we use today pretty much.
- 13:41Speaker 3: The book states it's starkly all public cryptosystems we have
- 13:45Speaker 3: covered thus far can be broken in polynomial time by
- 13:48Speaker 3: a quantum computer.
- 13:49Speaker 1: Okay, wow, So what's the plan? Are we heading for
- 13:52Speaker 1: crypto apocalypse?
- 13:54Speaker 3: Well? Hopefully not. This is the whole field of post
- 13:56Speaker 3: quantum cryptography or PKEC. Researchers worldwide are racing to develop
- 14:00Speaker 3: and standardize new public key cryptosystems based on different mathematical problems,
- 14:04Speaker 3: ones believed to be hard even for quantum computers, like
- 14:07Speaker 3: what kind of problems Things like lattice based cryptography are
- 14:10Speaker 3: big contenders, problems like lwe learning with errors. There's also
- 14:15Speaker 3: hash based signatures, code based crypto, a few different families. NIST,
- 14:20Speaker 3: the US standards body, has been running a competition to
- 14:23Speaker 3: select the best candidates and they've chosen the first set
- 14:26Speaker 3: of standards.
- 14:27Speaker 2: So we're actively replacing the old algorithms.
- 14:30Speaker 3: The transition is starting. It's a massive undertaking, but essential.
- 14:35Speaker 3: Even symmetric crypto needs adjustments. Hash functions need bigger outputs,
- 14:40Speaker 3: maybe doubling key sizes for as against certain quantum attacks,
- 14:44Speaker 3: just to maintain the same security level. Grower's algorithm effects
- 14:47Speaker 3: symmetric search problems.
- 14:48Speaker 1: So it really touches everything.
- 14:50Speaker 3: It really does. It's a fundamental shift in the underlying assumptions.
- 14:53Speaker 2: Wow, from visioneer and statistical tricks to lattices and quantum resistance.
- 14:58Speaker 1: It's just been this constant evolution, this arms race.
- 15:00Speaker 3: Absolutely the attacker finds a weakness, the defender builds a
- 15:03Speaker 3: stronger wall using deeper mathematics. It constantly pushes the boundary
- 15:07Speaker 3: of what we thought was computationally possible.
- 15:09Speaker 2: So what does this all mean for you listening right now, Well,
- 15:13Speaker 2: it means that the invisible shield protecting your emails, your
- 15:16Speaker 2: bank accounts, your online life is constantly being rebuilt, reinforced
- 15:21Speaker 2: with new kinds of math.
- 15:22Speaker 3: It's a silent, ongoing process, but absolutely critical.
- 15:26Speaker 2: So next time you see that padlock or hit send
- 15:29Speaker 2: on an encrypted message, maybe take a second think about
- 15:31Speaker 2: that hidden dance of math, the assumptions, the proofs keeping
- 15:34Speaker 2: your data safe, and consider how cryptographers right now are
- 15:38Speaker 2: choreographing the next dance, designing the steps needed to withstand
- 15:42Speaker 2: the incredible power of computers that don't even fully exist yet.
- 15:45Speaker 2: It's quite something