Week 6: Authentication Flashcards
Why is block cipher padding necessary?
Each block must be of same size for encryption algorithms to work.
Explain the Padding Oracle Attack.
An adversary can intercept and modify a single bit in the ciphertext which triggers a single bit change in the plaintext.
With CBC mode, an adversary can target the ending block to figure out where padding is.
Because a change in ciphertext padding bit would result in a modified behavior from the receiver.
Then the adversary can use the padding information to figure out the previous block bits, by incrementing the number of padding bits in the last block.
What is MAC and what is its purpose?
MAC: Message Authentication Code
A MAC is used to ensure message is authentic, has not been modified in any way.
How does a MAC function work?
Input: Arbitrary plaintext and key
Output: fixed length value (authenticator tag)
Why does a MAC function need a key?
A MAC function needs a key to ensure only user with key can generate that sort of MAC.
If a pure hash function is used, the MAC can still be valid even if message was tampered.
How is MAC used by sender and receiver?
Sender uses MAC to generate tag with key and plaintext.
Receiver uses MAC to generate tag with key and plaintext and checks tag against sent tag.
What is Authenticated Encryption?
Authenticated Encryption is a block cipher mode which has a MAC tag.
What are the inputs and outputs of Authenticated Encryption?
Inputs: plaintext, encryption key, MAC key
Outputs: ciphertext and MAC tag
What are the different implementation approaches of authenticated encryption tag generation?
MAC-then-encrypt = enc( plaintext + MAC(plaintext) ) MAC-and-encrypt = enc(plaintext) + MAC(plaintext) Encrypt-then-MAC = enc(plaintext) + MAC(enc(plaintext))
Which Authenticated Encryption is best and why?
Encrypt-then-MAC is best because it provide integrity of the ciphertext, no need to decrypt message.
What is Galois Counter Mode (GCM)?
Implementation of Authenticated Encryption.
Generates tag by using ciphertext blocks as coefficients in pa polynomial which is evaluated at a value derived from the key.