Cryptography Lecture 11.

Slides:



Advertisements
Similar presentations
CIS 5371 Cryptography 3b. Pseudorandomness.
Advertisements

CMSC 414 Computer and Network Security Lecture 4 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Lecture 4.1: Hash Functions, and Message Authentication Codes CS 436/636/736 Spring 2015 Nitesh Saxena.
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
CMSC 414 Computer and Network Security Lecture 5 Jonathan Katz.
Cryptography Lecture 2 Arpita Patra. Summary of Last Class  Introduction  Secure Communication in Symmetric Key setting >> SKE is the required primitive.
1 CIS 5371 Cryptography 4. Message Authentication Codes B ased on: Jonathan Katz and Yehuda Lindell Introduction to Modern Cryptography.
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
CS555Spring 2012/Topic 71 Cryptography CS 555 Topic 7: Stream Ciphers and CPA Security.
CS555Spring 2012/Topic 81 Cryptography CS 555 Topic 8: Pseudorandom Functions and CPA Security.
Cryptography Lecture 9 Arpita Patra © Arpita Patra.
Cryptography Lecture 10 Arpita Patra © Arpita Patra.
Cryptography Lecture 6 Arpita Patra. Quick Recall and Today’s Roadmap >> MAC for fixed-length messages >> Domain Extension for MAC >> Authenticated Encryption:
Symmetric-Key Cryptography CS 161: Computer Security Prof. Raluca Ada Popa Sept 13, 2016.
Message Authentication Codes
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
Authenticated encryption
Homework 1 Due: Thursday at 9 AM (beginning of class)
Modern symmetric-key Encryption
Secrecy of (fixed-length) stream ciphers
B504/I538: Introduction to Cryptography
Cryptography Lecture 9.
Cryptography Lecture 26.
Topic 11: Authenticated Encryption + CCA-Security
Cryptography Lecture 3.
Cryptography Lecture 13.
Cryptography Lecture 12.
Cryptography Lecture 4.
Cryptography Lecture 19.
Cryptography Lecture 6.
Cryptography Lecture 10.
Topic 7: Pseudorandom Functions and CPA-Security
B504/I538: Introduction to Cryptography
Cryptography Lecture 11 Arpita Patra © Arpita Patra.
Cryptography Lecture 7 Arpita Patra © Arpita Patra.
Cryptography Lecture 7.
Cryptography Lecture 25.
Cryptography Lecture 7 Arpita Patra © Arpita Patra.
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
Cryptography Lecture 12 Arpita Patra © Arpita Patra.
Cryptography Lecture 4.
Cryptography Lecture 5.
Cryptography Lecture 8.
Security of Wireless Sensor Networks
Cryptography Lecture 11.
Cryptography Lecture 9.
Cryptography Lecture 12.
Topic 13: Message Authentication Code
Cryptography Lecture 6.
Cryptography Lecture 7.
Cryptography Lecture 14.
Cryptography Lecture 9 Arpita Patra © Arpita Patra.
Cryptography Lecture 13.
Cryptography Lecture 3.
Cryptography Lecture 10.
Cryptography Lecture 9.
Cryptography Lecture 11.
Cryptography Lecture 10.
Cryptography Lecture 6.
Cryptography Lecture 21.
Cryptography Lecture 13.
Cryptography Lecture 25.
Cryptography Lecture 24.
Cryptography Lecture 23.
Cryptography Lecture 26.
Secret-Key Encryption
Blockchains Lecture 4.
Presentation transcript:

Cryptography Lecture 11

A fixed-length MAC

Construction Let F be a length-preserving pseudorandom function (aka block cipher) Construct the following MAC : Gen: choose a uniform key k for F Mack(m): output Fk(m) Vrfyk(m, t): output 1 iff Fk(m)=t Theorem:  is a secure MAC

Proof by reduction m1 m1 D t1 t1 … … mi mi PRF/random ti ti m m, t t* if (m is new and t=t*) output 1

Analysis When D interacts with Fk for uniform k, the view of the adversary is identical to its view in the real MAC experiment Pr[DFk outputs 1] = Pr[ForgeAdv, (n) = 1] When D interacts with uniform f, then seeing f(m1), …, f(mi) does not help predict f(m) for any m {m1, …, mi} Pr[Df outputs 1] ≤ 2-n

Analysis Since F is a pseudorandom function, | Pr[DFk outputs 1] - Pr[Df outputs 1] | < negl(n)  Pr[ForgeAdv, (n) = 1] = Pr[DFk outputs 1] ≤ 2-n + negl(n)

Drawbacks? This only works for fixed-length messages This only works for short messages E.g., AES has a 128-bit block size (shorter than a tweet!) So the previous construction is limited to authenticating short, fixed-length messages

Suggestions? Can you construct a secure MAC for variable-length messages from a MAC for fixed-length messages? One natural idea: Mac’k(m1, …, ml) = Mack(m1), …, Mack(ml) Vrfy’k(m1, …, ml, t1, …, tl) = 1 iff Vrfyk(mi, ti) = 1 for all i Is this secure?

A construction Need to prevent (at least) One solution: Block reordering Truncation “Mixing-and-matching” blocks from multiple messages One solution: Mac’k(m1, …, ml) = r, Mack(r | l | 1 | m1), Mack(r | l | 2 | m2), … Not very efficient – can we do better?

(Basic) CBC-MAC m1 m2 ml   … Fk Fk Fk t

CBC-MAC vs. CBC-mode CBC-MAC is deterministic (no IV) MACs do not need to be randomized to be secure Verification is done by re-computing the result In CBC-MAC, only the final value is output Both are essential for security Exercise: show attacks

Security of (basic) CBC-MAC? If F is a pseudorandom function with block length n, then for any fixed l basic CBC-MAC is a secure MAC for messages of length l·n The sender and receiver must agree on the length parameter l in advance Basic CBC-MAC is not secure if this is not done! Attacks?

CBC-MAC extensions Several ways to handle variable-length messages One of the simplest: prepend the message length before applying (basic) CBC-MAC

CBC-MAC l m1 m2 ml    … Fk Fk Fk Fk t

CBC-MAC extensions Several ways to handle variable length messages One of the simplest: prepend the message length before applying (basic) CBC-MAC Can also be adapted to handle messages whose length is not a multiple of the block length

Authenticated encryption

Secrecy + integrity? We have shown primitives for achieving secrecy and integrity in the private-key setting What if we want to achieve both?

Authenticated encryption An encryption scheme that achieves both secrecy and integrity Secrecy notion: CCA-security Integrity notion: unforgeability Adversary cannot generate ciphertext that decrypts to a previously unencrypted message

Constructions? Generic constructions Direct constructions Encrypt and authenticate Authenticate then encrypt Encrypt then authenticate Direct constructions

Generic constructions Generically combine an encryption scheme and a MAC Useful when these are already available in some library Goal: the combination should be an authenticated encryption scheme when instantiated with any CPA-secure encryption scheme and any secure MAC

Encrypt and authenticate c, t k1, k2 k1, k2 m c  Enck1(m) t = Mack2(m) m = Deck1(c) Vrfyk2(m, t) = 1?

Problems The tag t might leak information about m! Nothing in the definition of security for a MAC implies that it hides information about m So the combination may not even be EAV-secure If the MAC is deterministic (as is CBC-MAC), then the tag leaks whether the same message is encrypted twice I.e., the combination will not be CPA-secure