CH21 CompSec4e
CH21 CompSec4e
Requirements:
• Must support hash value lengths of 224, 256,384, and 512
bits
• Algorithm must process small blocks at a time instead of
requiring the entire message to be buffered in memory
before processing it
HMAC
• Interest in developing a MAC derived from a
cryptographic hash code
• Cryptographic hash functions generally execute faster
• Library code is widely available
• SHA-1 was not deigned for use as a MAC because it does not
rely on a secret key
• Issued as RFC2014
• Has been chosen as the mandatory-to-
implement MAC for IP security
• Used in other Internet protocols such as Transport Layer
Security (TLS) and Secure Electronic Transaction (SET)
HMAC Design Objectives
To preserve the original
To use, without modifications, performance of the hash
available hash functions function without incurring a
significant degradation
To have a well-understood
cryptographic analysis of the
To use and handle keys in a strength of the authentication
simple way mechanism based on
reasonable assumptions on the
embedded hash function
Security of HMAC
• Security depends on the cryptographic strength of the underlying
hash function
• The appeal of HMAC is that its designers have been able to prove an
exact relationship between the strength of the embedded hash
function and the strength of HMAC
• For a given level of effort on messages generated by a legitimate
user and seen by the attacker, the probability of successful attack on
HMAC is equivalent to one of the following attacks on the
embedded hash function:
• The attacker is able to compute an output of the compression function even with an IV
that is random, secret, and unknown to the attacker
• The attacker finds collisions in the hash function even when the IV is random and secret
RSA Public-Key Encryption
• By Rivest, Shamir & Adleman of MIT in 1977
• Best known and widely used public-key algorithm
• Uses exponentiation of integers modulo a prime
• Encrypt: C = Me mod n
• Decrypt: M = Cd mod n = (Me)d mod n = M
• Both sender and receiver know values of n and e
• Only receiver knows value of d
• Public-key encryption algorithm with public key PU =
{e, n} and private key PR = {d, n}
Security of RSA
Brute force
Mathematical attacks
Timing attacks
Progress in
Factorization
Timing Attacks
• Paul Kocher, a cryptographic consultant, demonstrated
that a snooper can determine a private key by keeping
track of how long a computer takes to decipher messages
• Timing attacks are applicable not just to RSA, but also to
other public-key cryptography systems
• This attack is alarming for two reasons:
• It comes from a completely unexpected direction
• It is a ciphertext-only attack
Timing Attack
Countermeasures
Constant
Random delay Blinding
exponentiation time
m
u
s
t
s
o
l
v
e
:
• 3
a
m
o
d
3
5
3
4
0
w
h
i
c
h
i
s
h
a
r
d
• D
e
s
i
r
e
d
a
n
s
w
e
r
i
s
9
7
,
t
h
e
n
c
o
m
p
u
t
e
k
e
y
a
s
d
o
e
s
Man-in-the-Middle Attack
• Attack is:
1. Darth generates private keys XD1 and XD2, and their
public keys YD1 and YD2
2. Alice transmits YA to Bob
3. Darth intercepts YA and transmits YD1 to Bob. Darth
also calculates K2
4. Bob receives YD1 and calculates K1
5. Bob transmits XA to Alice
6. Darth intercepts XA and transmits YD2 to Alice. Darth
calculates K1
7. Alice receives YD2 and calculates K2
• All subsequent communications compromised
Other Public-Key Algorithms
Digital Signature
Elliptic-Curve
Standard (DSS) Cryptography (ECC)