These slides are from a lecture I designed and repeatedly gave in the course on Applied Cryptography at TU Eindhoven.
It was placed as the second lecture in the course, to be given in the same weak as the first one, that was meant to introduce
provable security and the random oracle model. The idea here was to first introduce the students to security proofs and show them how they are important,
only to then demonstrate on a high-profile example, that proofs can very much still be wrong.
Also note that I gave the lecture in a classroom with a blackboard, where it was far easier to explain some of the more technical things;
the recording I provide here did not have that benefit and also lacks tracking of any pointers, making especially the explanation of some of the more technical mathematical aspects less ideal.
Still though: This is primarily a slide-show and a lot of information was meant to be passed via the spoken word, so I would generally still reocmmend to view it in slide-show mode with the recording.
(I don’t have captions as of now, and given that this is a full hour recording, I won’t make any promises for how soon (if ever) they’ll be available. Sorry.)
Overview
I am only providing the slides for the second lecture here, since the slides for the first lecture are not mine, but Andreas Hülsing’s who was (and is) the responsible professor for the overal course;
that said, I understand that this creates the somewhat unfortunate situation that the following slides might assume more previous knowledge than would be ideal, but it is what it is…
Last Time: Proofs are important
Allow quick development of protocols
Focuses cryptanalytic research on fewer targets.
Enforces the use of formal security statements
Today: Proofs are not a silver Bullet
Are the assumptions true?
Are the assumptions used correctly?
Does the proof really say what you think it does?
Is the proof itself correct?
Blockciphers and Modes
Take a key and a message-block
and return a ciphertext-block . ()
“Keyed Permutation” or “PseudoRandom Permutation” (PRP)
If is unknown, its associated permutation should be indistinguishable from a truly random permutation.
Formal Definition (for Completeness)
PRP-security in the CPA setting:
PRP-security in the CCA setting:
Not an Encryption Scheme! Merely a building-block.
Modes: ECB
Our Plaintext.After Encryption with AES in ECB-mode.
Modes: CTR
Same Plaintext.But this time encrypted with Counter-Mode
Modes: CTR
Let’s XOR a gnu on top of the ciphertextThe result still looks random.
Modes: CTR
But once we decrypt…
Modes
Blockciphers are not encryption-schemes!
If someone tells you “We encrypt everything with AES”, look for penguins.
Secure modes are important and non-trivial!
Confidentiality alone is usually not enough!
IND-CPA + MAC sometimes works, but we can do much better…
AE(AD)
Authenticated Encryption (with Associated Data)
Ciphertext does not reveal information about the plaintext
except for its length
even with an encryption (and a decryption) oracle
even if the adversary chooses the nonces
It is impossible to create a valid ciphertext without knowledge of the key
even with an encryption and a decryption oracle
Essentially IND$-CPA + EU-CMA
IND$-CPA IND-CPA with adversarially chosen nonces.
Combined these also imply CCA-security
Formal Definition of Confidentiality
(Every oracle query must use a fresh nonce!)
For CCA-Security add a decryption-oracle. (Thanks to the authenticity it will however answer all fresh queries with ⊥)
Formal Definition of Authenticity
(Every oracle query must use a fresh nonce!)
Offset Codebook Mode 2 (OCB2)
Invented by Phil Rogaway
ISO-standard
Little use in standardized internet-protocols due to patents
Nonce instead of random IV
1 blockcipher application per bits of message.
Almost no overhead beyond that.
Tweakable Blockcipher
Similar to regular blockciphers, but take an additional tweak.
Indistinguishable from a random permutation per tweak and per key.
Indistinguishability in the CCA setting:
samples a random permutation for each .
(For just CPA simply remove the decryption-oracles.)
XEX and XE
XEX and XE
Let be primitive elements.
Let with so that:
so that:
and
let be a Nonce.
Compute
Compute
Define
Define
Define
Define
OCB2
Proof
Large difference between protocol and security game
→ “Game Hopping”
XE is a CPA-secure tweakable blockcipher
always gets access to an (encryption-) oracle.
The specific oracle is replaced multiple times:
Game 1: XE with actual blockcipher
Game 2: XE with a truly random permutation
Game 3: XE with a truly random function
Game 4: Truly random function
Game 5: Truly random permutation per tweak
Let be the probability that outputs 1 in game .
Goal:
From XE[Blockcipher] to XE[Random Permutation]
Claim:
Replace all computations of the blockcipher with calls to the PRP-oracle.
If the PRP-challenger presents us the real blockcipher, this is identical to game 1.
If it presents the truly random permutation, this is identical to game 2.
If the CPA-attacker changes its behaviour between these to game, we can use that to distinguish between them.
⇒ is bounded by the achievable advantage over the security of in the PRP-game!
From XE[Random Permutation] to XE[Random Function]
Claim:
Only different if a collision occurs
Outputs are truly random.
With calls and blocksize of bits the probability for a collision is at most
⇒ Since the number of oracle queries () is at most polynomial whereas is exponential
in the security parameter, this is negligible.
From XE[Random Function] to Random Function
Then a miracle occurs…
It provides us with
From Random Function to Random Permutation
Claim:
Like second hop, just the other way around.
Putting it all together.
⇒ Since both of these are by assumption negligible, XE with a secure blockcipher provides a secure tweakable blockcipher in CPA settings.
XEX and XEX*
The proof for XEX is similar
XEX* provides the adversary with an encryption and a decryption oracle.
Add to the tweak
If , use XE for CPA-security otherwise XEX for CCA-security
forbidden to query both and
forbidden to query decryptions with .
XEX*
Game 1: XEX* with regular blockcipher:
Game 2: XEX* with random permutation:
Game 3: Random Answers:
Game 4: Random permutation per tag:
Hop 1 is pretty much the same as it was with XE, same for Hop 3. Hop 2 is much more complicated and interested students should just read the original paper.
Security of OCB2
Confidentiality
From the original paper:
During the adversary’s attack it asks a sequence of queries
where the -values are distinct. Since the -values are distinct each and
that gets used gets used exactly once. We are thus applying a number of independent
random permutations each to a single point. The image of a single point under a random
permutation is uniform, so the output is perfectly uniform. That is all that is needed
to ensure that an adversary has no advantage to distinguish the output from random bits.
Authenticity
More complicated, but similar idea.
Attacking OCB
Akiko Inoue and Kazuhiko Minematsu Enter the Stage
Let , with , , arbitrary
Use encryption-oracle with .
Receive
Let , , and .
Present to the challenger.
Does this really Work?
Preliminary Summary
This is a valid forgery containing a never requested plaintext!
⇒ OCB2 is not a secure authenticated encryption scheme!
What went wrong?
“But there was a proof that it is secure!”
“Since the -values are distinct each and
that gets used gets used exactly once.”
“forbidden to query both and ”
⇒ Argument was to hand-wavey!
Longer Messages
The first Blocks only xor the checksum with a known value.
Let
Let for .
Let
Similar workout as before, just more complicated.
Distinguishing attacks
IND-CCA was the result of IND$-CPA + authenticity
It turns out that there is a simple attack
Clark Kent vs Superman: Slightly different looks, still the same person.
⇒ OCB2 is not IND-CCA secure!
Attacks only ever get better: Universal Forgeries
Extract
Compute random input-output-pairs for the blockcipher
Compute specific input-output-pairs for the blockcipher
Compute the ciphertext using the regular algorithm.
⇒ Perfect universal forgeries with at most three oracle-queries!
And better: Plaintext Recovery
Extract with encryption oracle from previous attack
pick random .
for
Perform decryption-query with .
Profit.
⇒ Full plaintext extraction!
History of the Attacks
OCB2 was widely believed to be secure.
Akiko Inoue and Kazuhiko Minematsu find a small crack that allowed a first attack.