Lecture 11
Lecture 11
Digital Signatures
Symmetric-key Asymmetric-key
Integrity,
Authentication
2
Story So Far
Symmetric-key Asymmetric-key
4
Digital Signatures
YES!
Certificate Authority
Is this Alice’s
signature? 5
Digital Signatures
D E
M S S,M
6
RSA Signatures
● Existential forgery
○ The attacker manages to forge a signature of (at least) one
message, but not necessarily of his choice
● Selective forgery
○ The attacker manages to forge a signature of (at least) one
message of his choice
● Universal forgery
○ The attacker manages to forge a signature of any message
8
Summary
9
Cryptographic Hash
10
Cryptographic Hash
12
One-way Functions
13
One-way Functions
● Is
H( )=
14
Cryptographic Hash
15
Cryptographic Hash
16
Hashing Algorithms
17
Collision
● Is H(X) = 1 collision-resistant?
● Is H(s) = “Take first letter of each word in a sentence s”
collision-resistant?
● Is
H( )= ?
18
Collision Resistance
How large should N be to have a reasonable
chance (p>0.5) to find a collision?
19
Collision Resistance - Birthday Problem
How many people should be there in a room
so that there is a reasonable chance (p > 0.5)
of two persons sharing the same birthday?
=365
20
Collision Resistance - Birthday Problem
21
Collision Resistance - Birthday Attack
22
Merkle-Damgård Construction
RESULT
23
Hashes and Integrity
24
MD5
25
MD5
26
MD5 Padding and Sequencing
27
MD5 Process
● IV=initialization vector
○ A0 = 01234567
○ B0 = 89ABCDEF
○ C0 = FEDCBA98
○ D0 = 76543210
● Every stage consists of four rounds over the message block
28
MD5 Stage i CVi-1
Bi
CVi 29
MD5 Stage i
30
MD5
● Given H(x) and the length of x, but not x, an attacker can create
H(x || m) for any m of the attacker’s choosing
● Hash algorithms based on Merkle-Damgard construction are
vulnerable to this attack
● Message digest from F can be used in the next stage to get the
new hash without knowing x
32
Cryptographic Hash and Integrity
33
Message Authentication Codes (MAC)
34
Message Authentication Codes
36
Hash Message Authentication Code (HMAC)
● Hash-based MAC
○ Cryptographic hash
○ Secret key
● Provide authentication using a shared secret instead of using
digital signatures
● Normally, we could have done MAC = H(Key || Message)
but this is susceptible to length extension attacks
● Instead, we do MAC = H(Key || H(Key || Message))
37
HMAC
38
Randomness
40
Pseudorandom number generators (PRNGs)
41
Insecure PRNGs
42
Authenticated Encryption
43
Authenticated Encryption
44
Authenticated Encryption
45
MAC-then-Encrypt
47
Authenticated Encryption
48
Authenticated Encryption with Additional Data
49
Public Key Infrastructure
E D
M C M
50
Public Key Infrastructure
● Certificate Authority
○ Issues certificates
■ Endorses the public key of a participant
■ Binds the participant’s name to the public key
● Trust Anchor
○ Entity for which trust is assumed and not derived
○ Trust others’ data through the anchor
○ Identify a certificate authority using a root certificate
○ Stores certificates for all the participants that trust the anchor
○ Establish a chain of trust
■ Verify the sender and intermediate certificate issuers
51
Chain of Trust Charlie
{KC}KA’
Alice
{KA}KCA’
DeeDee
{KD}KA’ Elsa
{KE}KD’
Trust anchor
{KCA}KCA’ Bob
{KB}KCA’
52
Trust Anchors
53
Trust Anchors
54
Trust Anchors
55
Trust Anchors
56
Web-of-Trust
57
Web-of-Trust
58
Web-of-Trust
● Challenges
○ Trust is not transitive
■ Just because Alice trusts Bob and Bob trusts Charlie,
it does not mean that Alice trusts Charlie
○ Trust is not absolute
■ You may trust someone for specific tasks but not other tasks
■ Some security expert:
“I trust my bank with my money but not with my children;
I trust my relatives with my children but not with my money.”
59
Stored Certificates
60
Certificate Revocation
62
Pretty Good Privacy
63
Passwords
64
Passwords
65
Passwords
66
Passwords
67
Passwords
68
Passwords
69
Password Hashes
70
Attacks on Hashes
71
Offline Attacks on Password Hashes
● Add salt
○ Unique random number per user
○ For each user, store: username, salt,
H(password || salt)
○ To verify a password, look up the user’s
salt in the file, compute H(password || salt),
and check it matches the hash in the file
○ Salts are not secret
73
Solutions for Offline Attacks on Password Hashes
● Slow Hash
○ Use a hash function that computes hashes slowly
○ Legitimate users will not notice if it takes 0.0001 seconds or 0.1 seconds
for the server to check a password.
○ However, adversaries need to compute millions of hashes; using a slow
hash can slow the brute-force attack making them impractical
74
Online Attacks on Password Hashes
75
Solution to Online Attacks on Passwords
● Rate-limiting
○ Limit the number of tries within a time limit
○ Lock accounts if a certain number of tries fail
○ May result in DoS
● Impose password requirements
○ Make it harder to guess password
● CAPTCHAs
○ Make it longer for adversary to complete a guess
○ Can remove the possibility of automated checks
● These may not help against untargeted attacks
76
Choosing Passwords
https://xkcd.com/538/ 77