SlideShare une entreprise Scribd logo
1  sur  48
Télécharger pour lire hors ligne
CNIT 141
Cryptography for Computer Networks
11. Diffie-Hellman
Topics
• The Diffie-Hellman Function
• The Diffie-Hellman Problems
• Key Agreement Protocols
• Diffie-Hellman Protocols
• How Things Can Go Wrong
1976
• Whitfield Diffie and Martin Hellman
• Published "New Directions in Cryptography"
• Revolutionized cryptography
• Specified a public-key distribution scheme
• The Diffie-Hellman (DH) protocol
• The basis for public-key encryption and
signatures
Key Agreement
• After exchanging a shared secret
• Parties turn the secret into a symmetric key
• Thus establishing a secure channel
The Diffie-Hellman
Function
The Group Zp*
• The integers 1, 2, 3, ... p-1
• Where p is prime
• In DH, the two parties choose random
elements a and b to be their secrets
• From the group
• Both parties also use a number g
• Which is not a secret
Alice and Bob
• They can both calculate gab by combining
public and secret information
Keep a secret

Transmit ga
Keep b secret

Transmit gb
Diffie-Hellman
• Alice calculates A = ga mod p
• and sends it to Bob
• Bob calculates B = gb mod p
• and sends it to Alice
• Alice calculates Ba mod p = gba mod p
• Bob calculates Ab mod p = gab mod p
• They now have the same shared secret
Key Derivation Function
(KDF)
• The shared secret is not used directly as the
key
• It's passed through a KDF to create a random-
looking value of the proper size
• A kind of hash function
Safe Primes
• Not all values of p and g work
• For highest security, both p and (p - 1) / 2
should be prime
• Those are called safe primes
• They don't have small subgroups
• That would limit the shared secret to a small
number of possible values
Safe Primes
• With safe primes even a g of 2 works
• But safe primes are slow to generate
• 1000x as long as generating mere random
primes
Generating 2048-bit DH
• 154 seconds
Generating 2048-bit RSA
• 0.17 seconds
The Diffie-Hellman
Problems
Discrete Logarithm
Problem
• Public value: ga
• Secret value: a
• Recovering a from ga is the DLP
• Diffie-Hellman's security depends on the DLP's
hardness
Eavesdropper
• Evil attacker knows only ga and gb
Keep a secret

Transmit ga
Keep b secret

Transmit gb
The Computational Diffie-
Hellman Problem (CDH)
• Consider an eavesdropper
• Compute the shared secret gab
• Given only the public values ga and gb
• And not the secrets a or b
• This might be easier than the DLP
• We don't know for sure
Number Sieve
• DH protocol with 2048 bit prime p provides 90
bits of security
• Same as RSA with a 2048-bit n
• Fastest known attack on Computational Diffie-
Hellman is the number field sieve
• Similar to the fastest known attack on RSA:
the "general number field sieve"
Decisional Diffie-Hellman
Problem (DDH)
• Stronger than CDH's hardness assumption
• If DDH is hard, the attacker can't learn
anything about the shared secret from the
public information
• Not even a few bits of it
• Because it appears completely random
• Both DDH and CDH are hard if the
parameters are well-chosen
Key Agreement Protocols
A Non-DH Key Agreement
Protocol
• Authenticated Key Agreement (AKA)
• Used by 3G and 4G
• To establish secure communication between a
SIM card and a telecom operator
• Uses only symmetric-key operations
• Relies on a pre-shared secret K
Replay Attack
• Attacker captures pair (R, V1)
• Sends it to SIM card to open a new session
impersonating the telco
• To precent this, protocol checks to make sure
R isn't reused
Compromised K
• Attacker who gets K
• Can perform MiTM attack and listen to all
cleartext communications
• Can impersonate either party
• Can record communications and later
decrypt them using the captured R values
Attack Models for
Key Agreement Protocols
• Eavesdropper
• Attacker is a MiTM
• Can record, modify, drop or inject messages
• To stop: protocol must not leak any
information about the shared secret
• Data leak
• Attacker gets the session key and all
temporary secrets
• But not long-term secret K
Attack Models for
Key Agreement Protocols
• Breach
• Attacker learns long-term key K
• Impossible to protect current session from
this attack
• But a protocol can protect other sessions
Security Goals
• Authentication
• Mutual authentication: each party can
authenticate to the other party
• Authenticated Key Agreement happens
when a protocol authenticates both parties
Security Goals
• Key control
• Neither party can control the final shared
secret
• The 3G/4G protocol lacks this property
• Because the operator chooses R
• Which entirely determines the final shared
key
Security Goals
• Forward secrecy
• Even if all long-term secrets are exposed
• Shared secrets from previous sessions are
not available
• 3G/4G protocol doesn't provide this
Performance
• Number of messages exchanged
• Message length
• Computations required
• Possibility of pre-computation
• The main cause of latency is usually round-
trip time
• Computation required also counts
Performance of 3G/4G
• Exchanges two messages of a few hundred
bits each
• Pre-computation is possible
• Operator can pick many values of R in
advance
Diffie-Hellman Protocols
Anonymous Diffie-Hellman
• Not authenticated
• Vulnerable to MiTM attack (next slide)
Authenticated Diffie-Hellman
• Uses public-key signatures to sign messages
• With a system such as RSA-PSS
Security Against
Eavesdroppers
• Authenticated DH stops eavesdroppers
• Attacker can't learn the shared secret gab
• Neither party can control the shared secret
Replay
• Eve can record and replay previous values of
A and sigA
• To pretend to be Alice
• Key confirmation prevents this
• Alice and Bob send a message to prove that
they both own the shared secret
Security Against Data Leaks
• If Eve has a, she can impersonate Alice
• To prevent this, integrate long-term keys into the
shared secret computation
Memezes-Qu-Vanstone
MQV
• Designed in 1998
• NSA included it in Suite B
• Designed to protect classified information
• More secure than authenticated DH
• Better performance
MQV
• x and y are long-term private keys
• X and Y are long-term public keys
Data Leak
• Attacker who gets the ephemeral secrets a
and b
• Can't find the shared secret
• That would require knowing the long-term
private keys
Breach
• Attacker gets Alice's long-term private key x
• Previous sessions are still safe
• Because they used Alice's ephemeral private
keys
• There is an attack that could compromise a
targeted old session
• It can be mitigated by a key-confirmation
step
MQV Rarely Used
• Was encumbered by patents
• Complex and difficult to implement
• Authenticated DH is simpler and regarded as
good enough
How Things Can Go
Wrong
Not Hashing the Shared
Secret
• The shared secret gab is not a session key
• A symmetric key should look random
• Every bit should be 50% likely to be 0
• But gab is in the range 1, 2, ... p
• High-order bit more likely to be 0
• Use a KDF to convert the secret to a key
Legacy DH in TLS
• Old cipher suites uses Anonymous DH
• TLS_DH_anon_WITH_AES_128_CBC_SHA
• TLS_DH_ANON_AES_128_CBC_SHA1
• TLS_DH_anon_WITH_AES_128_CBC_SHA
• ADH-AES128-SHA
• Link Ch 11i
Unsafe Group Parameters
• OpenSSL allowed unsafe primes p
• Attacker can craft DH parameters that reveal
information about the private key
• Fixed in 2016
CNIT 141: 11. Diffie-Hellman

Contenu connexe

Tendances

CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
CNIT 141 6. Hash Functions
CNIT 141 6. Hash FunctionsCNIT 141 6. Hash Functions
CNIT 141 6. Hash FunctionsSam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSASam Bowne
 
CNIT 141: 13. TLS
CNIT 141: 13. TLSCNIT 141: 13. TLS
CNIT 141: 13. TLSSam Bowne
 
CNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated EncryptionCNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated EncryptionSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsSam Bowne
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingSam Bowne
 
CNIT 1417. Keyed Hashing
CNIT 1417. Keyed HashingCNIT 1417. Keyed Hashing
CNIT 1417. Keyed HashingSam Bowne
 
CNIT 126: 13: Data Encoding
CNIT 126: 13: Data EncodingCNIT 126: 13: Data Encoding
CNIT 126: 13: Data EncodingSam Bowne
 
CNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecurityCNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecuritySam Bowne
 
CNIT 141 10. RSA
CNIT 141 10. RSACNIT 141 10. RSA
CNIT 141 10. RSASam Bowne
 
CNIT 141 5. Stream Ciphers
CNIT 141 5. Stream CiphersCNIT 141 5. Stream Ciphers
CNIT 141 5. Stream CiphersSam Bowne
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
CISSP Certification Security Engineering-Part2
CISSP Certification Security Engineering-Part2CISSP Certification Security Engineering-Part2
CISSP Certification Security Engineering-Part2Hamed Moghaddam
 
CNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionCNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionSam Bowne
 

Tendances (20)

CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141 6. Hash Functions
CNIT 141 6. Hash FunctionsCNIT 141 6. Hash Functions
CNIT 141 6. Hash Functions
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSA
 
CNIT 141: 13. TLS
CNIT 141: 13. TLSCNIT 141: 13. TLS
CNIT 141: 13. TLS
 
CNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated EncryptionCNIT 141 8. Authenticated Encryption
CNIT 141 8. Authenticated Encryption
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash Functions
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed Hashing
 
CNIT 1417. Keyed Hashing
CNIT 1417. Keyed HashingCNIT 1417. Keyed Hashing
CNIT 1417. Keyed Hashing
 
CNIT 126: 13: Data Encoding
CNIT 126: 13: Data EncodingCNIT 126: 13: Data Encoding
CNIT 126: 13: Data Encoding
 
CNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic SecurityCNIT 141: 3. Cryptographic Security
CNIT 141: 3. Cryptographic Security
 
CNIT 141 10. RSA
CNIT 141 10. RSACNIT 141 10. RSA
CNIT 141 10. RSA
 
CNIT 141 5. Stream Ciphers
CNIT 141 5. Stream CiphersCNIT 141 5. Stream Ciphers
CNIT 141 5. Stream Ciphers
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
CISSP Certification Security Engineering-Part2
CISSP Certification Security Engineering-Part2CISSP Certification Security Engineering-Part2
CISSP Certification Security Engineering-Part2
 
CNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated EncryptionCNIT 141: 8. Authenticated Encryption
CNIT 141: 8. Authenticated Encryption
 

Similaire à CNIT 141: 11. Diffie-Hellman

11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...Zara Nawaz
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptxsamimaqbol
 
20 security
20 security20 security
20 securityabiy2004
 
Digital Security 101
Digital Security 101Digital Security 101
Digital Security 101Gary Jan
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)Sam Bowne
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network SecurityKathirvel Ayyaswamy
 
The Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmThe Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmJay Nagar
 
Lec 10 - Key Management.ppt
Lec 10 - Key Management.pptLec 10 - Key Management.ppt
Lec 10 - Key Management.pptIshaKanwal4
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptographyVaibhav Khanna
 
ch10.KeyManagement.Diffie-Hellman.ECC.ppt
ch10.KeyManagement.Diffie-Hellman.ECC.pptch10.KeyManagement.Diffie-Hellman.ECC.ppt
ch10.KeyManagement.Diffie-Hellman.ECC.pptSibiSriram
 
Ch 12: Cryptography
Ch 12: CryptographyCh 12: Cryptography
Ch 12: CryptographySam Bowne
 

Similaire à CNIT 141: 11. Diffie-Hellman (20)

11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...
 
CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem
 
SSL/TLS 101
SSL/TLS 101SSL/TLS 101
SSL/TLS 101
 
SSL/TLS 101
SSL/TLS 101SSL/TLS 101
SSL/TLS 101
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptx
 
man in the middle
man in the middleman in the middle
man in the middle
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
20 security
20 security20 security
20 security
 
Digital Security 101
Digital Security 101Digital Security 101
Digital Security 101
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)
 
Asymmetric Cryptography
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric Cryptography
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
The Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmThe Diffie-Hellman Algorithm
The Diffie-Hellman Algorithm
 
Lec 10 - Key Management.ppt
Lec 10 - Key Management.pptLec 10 - Key Management.ppt
Lec 10 - Key Management.ppt
 
16974 ch 15 key management
16974 ch 15 key management16974 ch 15 key management
16974 ch 15 key management
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptography
 
ch10.KeyManagement.Diffie-Hellman.ECC.ppt
ch10.KeyManagement.Diffie-Hellman.ECC.pptch10.KeyManagement.Diffie-Hellman.ECC.ppt
ch10.KeyManagement.Diffie-Hellman.ECC.ppt
 
Security - ch3.pptx
Security - ch3.pptxSecurity - ch3.pptx
Security - ch3.pptx
 
Ch 12: Cryptography
Ch 12: CryptographyCh 12: Cryptography
Ch 12: Cryptography
 

Plus de Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 

Plus de Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 

Dernier

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 

Dernier (20)

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 

CNIT 141: 11. Diffie-Hellman

  • 1. CNIT 141 Cryptography for Computer Networks 11. Diffie-Hellman
  • 2. Topics • The Diffie-Hellman Function • The Diffie-Hellman Problems • Key Agreement Protocols • Diffie-Hellman Protocols • How Things Can Go Wrong
  • 3. 1976 • Whitfield Diffie and Martin Hellman • Published "New Directions in Cryptography" • Revolutionized cryptography • Specified a public-key distribution scheme • The Diffie-Hellman (DH) protocol • The basis for public-key encryption and signatures
  • 4. Key Agreement • After exchanging a shared secret • Parties turn the secret into a symmetric key • Thus establishing a secure channel
  • 6. The Group Zp* • The integers 1, 2, 3, ... p-1 • Where p is prime • In DH, the two parties choose random elements a and b to be their secrets • From the group • Both parties also use a number g • Which is not a secret
  • 7. Alice and Bob • They can both calculate gab by combining public and secret information Keep a secret Transmit ga Keep b secret Transmit gb
  • 8. Diffie-Hellman • Alice calculates A = ga mod p • and sends it to Bob • Bob calculates B = gb mod p • and sends it to Alice • Alice calculates Ba mod p = gba mod p • Bob calculates Ab mod p = gab mod p • They now have the same shared secret
  • 9. Key Derivation Function (KDF) • The shared secret is not used directly as the key • It's passed through a KDF to create a random- looking value of the proper size • A kind of hash function
  • 10. Safe Primes • Not all values of p and g work • For highest security, both p and (p - 1) / 2 should be prime • Those are called safe primes • They don't have small subgroups • That would limit the shared secret to a small number of possible values
  • 11. Safe Primes • With safe primes even a g of 2 works • But safe primes are slow to generate • 1000x as long as generating mere random primes
  • 15. Discrete Logarithm Problem • Public value: ga • Secret value: a • Recovering a from ga is the DLP • Diffie-Hellman's security depends on the DLP's hardness
  • 16. Eavesdropper • Evil attacker knows only ga and gb Keep a secret Transmit ga Keep b secret Transmit gb
  • 17. The Computational Diffie- Hellman Problem (CDH) • Consider an eavesdropper • Compute the shared secret gab • Given only the public values ga and gb • And not the secrets a or b • This might be easier than the DLP • We don't know for sure
  • 18. Number Sieve • DH protocol with 2048 bit prime p provides 90 bits of security • Same as RSA with a 2048-bit n • Fastest known attack on Computational Diffie- Hellman is the number field sieve • Similar to the fastest known attack on RSA: the "general number field sieve"
  • 19. Decisional Diffie-Hellman Problem (DDH) • Stronger than CDH's hardness assumption • If DDH is hard, the attacker can't learn anything about the shared secret from the public information • Not even a few bits of it • Because it appears completely random • Both DDH and CDH are hard if the parameters are well-chosen
  • 21. A Non-DH Key Agreement Protocol • Authenticated Key Agreement (AKA) • Used by 3G and 4G • To establish secure communication between a SIM card and a telecom operator • Uses only symmetric-key operations • Relies on a pre-shared secret K
  • 22.
  • 23. Replay Attack • Attacker captures pair (R, V1) • Sends it to SIM card to open a new session impersonating the telco • To precent this, protocol checks to make sure R isn't reused
  • 24. Compromised K • Attacker who gets K • Can perform MiTM attack and listen to all cleartext communications • Can impersonate either party • Can record communications and later decrypt them using the captured R values
  • 25. Attack Models for Key Agreement Protocols • Eavesdropper • Attacker is a MiTM • Can record, modify, drop or inject messages • To stop: protocol must not leak any information about the shared secret • Data leak • Attacker gets the session key and all temporary secrets • But not long-term secret K
  • 26. Attack Models for Key Agreement Protocols • Breach • Attacker learns long-term key K • Impossible to protect current session from this attack • But a protocol can protect other sessions
  • 27. Security Goals • Authentication • Mutual authentication: each party can authenticate to the other party • Authenticated Key Agreement happens when a protocol authenticates both parties
  • 28. Security Goals • Key control • Neither party can control the final shared secret • The 3G/4G protocol lacks this property • Because the operator chooses R • Which entirely determines the final shared key
  • 29. Security Goals • Forward secrecy • Even if all long-term secrets are exposed • Shared secrets from previous sessions are not available • 3G/4G protocol doesn't provide this
  • 30. Performance • Number of messages exchanged • Message length • Computations required • Possibility of pre-computation • The main cause of latency is usually round- trip time • Computation required also counts
  • 31. Performance of 3G/4G • Exchanges two messages of a few hundred bits each • Pre-computation is possible • Operator can pick many values of R in advance
  • 33. Anonymous Diffie-Hellman • Not authenticated • Vulnerable to MiTM attack (next slide)
  • 34.
  • 35. Authenticated Diffie-Hellman • Uses public-key signatures to sign messages • With a system such as RSA-PSS
  • 36. Security Against Eavesdroppers • Authenticated DH stops eavesdroppers • Attacker can't learn the shared secret gab • Neither party can control the shared secret
  • 37. Replay • Eve can record and replay previous values of A and sigA • To pretend to be Alice • Key confirmation prevents this • Alice and Bob send a message to prove that they both own the shared secret
  • 38. Security Against Data Leaks • If Eve has a, she can impersonate Alice • To prevent this, integrate long-term keys into the shared secret computation
  • 39. Memezes-Qu-Vanstone MQV • Designed in 1998 • NSA included it in Suite B • Designed to protect classified information • More secure than authenticated DH • Better performance
  • 40. MQV • x and y are long-term private keys • X and Y are long-term public keys
  • 41. Data Leak • Attacker who gets the ephemeral secrets a and b • Can't find the shared secret • That would require knowing the long-term private keys
  • 42. Breach • Attacker gets Alice's long-term private key x • Previous sessions are still safe • Because they used Alice's ephemeral private keys • There is an attack that could compromise a targeted old session • It can be mitigated by a key-confirmation step
  • 43. MQV Rarely Used • Was encumbered by patents • Complex and difficult to implement • Authenticated DH is simpler and regarded as good enough
  • 44. How Things Can Go Wrong
  • 45. Not Hashing the Shared Secret • The shared secret gab is not a session key • A symmetric key should look random • Every bit should be 50% likely to be 0 • But gab is in the range 1, 2, ... p • High-order bit more likely to be 0 • Use a KDF to convert the secret to a key
  • 46. Legacy DH in TLS • Old cipher suites uses Anonymous DH • TLS_DH_anon_WITH_AES_128_CBC_SHA • TLS_DH_ANON_AES_128_CBC_SHA1 • TLS_DH_anon_WITH_AES_128_CBC_SHA • ADH-AES128-SHA • Link Ch 11i
  • 47. Unsafe Group Parameters • OpenSSL allowed unsafe primes p • Attacker can craft DH parameters that reveal information about the private key • Fixed in 2016