Notes
Outline
Practical Aspects of Modern Cryptography
Josh Benaloh & Brian LaMacchia
Lecture 4: AES, Hash Functions, and Protocols
Advanced Encryption Standard
Competition to replace the Data Encryption Standard (DES)
128-bit block size
Key sizes of 128, 192, and 256 bits
15 ciphers were submitted
5 finalists were chosen
AES Finalists
MARS (IBM submission)
RC6 (RSA Labs submission)
Rijndael (Joan Daemen and Vincent Rijmen)
Serpent (Anderson, Biham, and Knudsen)
Twofish (Schneier, et. al.)
Feistel Ciphers
Feistel Ciphers
Feistel Ciphers
AES Finalists
MARS (IBM submission)
RC6 (RSA Labs submission)
Rijndael (Joan Daemen and Vincent Rijmen)
Serpent (Anderson, Biham, and Knudsen)
Twofish (Schneier, et. al.)
Rijndael
Rijndael
4 transformations per round
ByteSub:  nonlinearity
ShiftRow:  inter-column diffusion
MixColumn:  inter-byte diffusion
Round key addition
Rijndael ByteSub
A single 8-bit to 8-bit (invertible) S-box is applied to each byte.
Rijndael MixColumn
An (invertible) linear transform is applied to each column.
Rijndael ShiftRow
An different cyclic shift is applied to each row.
Rijndael Round key addition
The round key is XORed to complete the round.
Rijndael Key Schedule
The key schedule is defined on 4-byte words by
ki = ki-4 Ä ki-1 when i is not a multiple of 4
ki = ki-4 Ä f(ki-1) when i is a multiple of 4
Cipher Integrity
When using block ciphers in CBC mode, there is generally a built-in integrity check.
However, when using block ciphers in ECB mode or (especially) when using stream ciphers, an external integrity check is crucial.
Such an integrity check is called a Message Authentication Code (MAC).
Stream Cipher Integrity
It is easy for an adversary (even one who can’t decrypt the ciphertext) to alter the plaintext in a known way.
Bob to Bob’s Bank: Please transfer $0,000,002.00 to the account of my good friend Alice.
Stream Cipher Integrity
It is easy for an adversary (even one who can’t decrypt the ciphertext) to alter the plaintext in a known way.
Bob to Bob’s Bank: Please transfer $1,000,002.00 to the account of my good friend Alice.
One-Way Hash Functions
The idea of a check sum is great, but it is designed to prevent accidental changes in a message.
For cryptographic integrity, we need an integrity check that is resilient against a smart and determined adversary.
One-Way Hash Functions
Generally, a one-way hash function is a function H : {0,1}* ® {0,1}k (typically k is 128 or 160) such that given an input value x, one cannot find a value x¢ ¹ x such H(x) = H(x¢ ).
One-Way Hash Functions
There are many measures for one-way hashes.
Non-invertability:  given y, it’s difficult to find any x such that H(x) = y.
Collision-intractability:  one cannot find a pair of values x¢ ¹ x such that H(x) = H(x¢ ).
An Example Hash: SHA-1
SHA-1 was designed by the US Government as part of the Digital Signature Standard.
SHA-1 is the most-commonly used hash function today.
It’s the hash function in which we have the most faith right now.
SHA-1 takes any size input and produces a 160-bit output (the digest value).
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
What’s in the final 32-bit transform?
Take the rightmost word.
Add in the leftmost word rotated 5 bits.
Add in a round-dependent function f of the middle three words.
A Cryptographic Hash:  SHA-1
A Cryptographic Hash:  SHA-1
Depending on the round, the “non-linear” function f is one of the following.
f(X,Y,Z) = (XÙY) Ú ((ØX)ÙZ)
f(X,Y,Z) = (XÙY) Ú (XÙZ) Ú (YÙZ)
f(X,Y,Z) = X Å Y Å Z
A Cryptographic Hash:  SHA-1
What’s in the final 32-bit transform?
Take the rightmost word.
Add in the leftmost word rotated 5 bits.
Add in a round-dependent function f of the middle three words.
A Cryptographic Hash:  SHA-1
What’s in the final 32-bit transform?
Take the rightmost word.
Add in the leftmost word rotated 5 bits.
Add in a round-dependent function f of the middle three words.
Add in a round-dependent constant.
A Cryptographic Hash:  SHA-1
What’s in the final 32-bit transform?
Take the rightmost word.
Add in the leftmost word rotated 5 bits.
Add in a round-dependent function f of the middle three words.
Add in a round-dependent constant.
Add in a portion of the 512-bit message.
A Cryptographic Hash:  SHA-1
One-Way Hash Functions
When using a stream cipher, a (keyed) hash of the message can be appended to ensure integrity.  [Message Authentication Code]
When forming a digital signature, the signature need only be applied to a hash of the message.  [Message Digest]
Cryptographic Tools
One-Way Trapdoor Functions
Public-Key Encryption Schemes
One-Way Permutations
One-Way Functions
One-Way Hash Functions
Pseudo-Random Number-Generators
Secret-Key Encryption Schemes
Digital Signature Schemes
Using Public Key Encryption
Now that we have all of these tools available, how do we actually send a (short) message, perhaps a symmetric key, encrypted with a public key?
PKCS#1v1 Message Format:
Recall the Bleichenbacher attack
 00 01 XX XX ... XX 00 YY YY ... YY
OAEP
Optimal Asymmetric Encryption Protocol
To encrypt the message M,
Select a random value r,
For a PRNG G and one-way hash H, use the public key to encrypt the following:
MÄG(r) || rÄH(MÄG(r))
Internet Protocols
1994:  Secure Sockets Layer (SSL) V2.0
1995:  Private Communication Technology (PCT) V1.0
1996:  Secure Sockets Layer (SSL) V3.0
1997:  Private Communication Technology (PCT) V4.0
1999:  Transport Layer Security (TLS) V1.0
Internet Protocols
You (client)
Merchant (server)
Internet Protocols
You (client)
Merchant (server)
Internet Protocols
You (client)
Merchant (server)
Internet Protocols
You (client)
Merchant (server)
Internet Protocols
You (client)
Merchant (server)
Internet Protocols
All subsequent secure messages are sent using the symmetric key and a keyed hash for message authentication.