Understanding Cryptography - A Textbook For Students and Practitioners
Understanding Cryptography - A Textbook For Students and Practitioners
Understanding Cryptography - A Textbook For Students and Practitioners
www.crypto-textbook.com
Chapter 6 – Introduction to
Public-Key Cryptography
ver. November 18, 2010
• The slides can used free of charge. All copyrights for the slides remain with
Christof Paar and Jan Pelzl.
• The title of the accompanying book “Understanding Cryptography” by
Springer and the author’s names must remain on each slide.
• If the slides are modified, appropriate credits to the book authors and the
book title must remain within the slides.
• It is not permitted to reproduce parts or all of the slides in printed form
whatsoever without written consent by the authors.
Alice Bob
x eK(x) dK(y) x
y
K K
K K
Safe with a strong lock, only Alice and Bob have a copy of the key
• Alice encrypts locks message in the safe with her key
• Bob decrypts uses his copy of the key to open the safe
n users in the network require keys, each user stores (n-1) keys
Example:
6 users (nodes)
6⋅5
= 15 keys (edges)
2
• Alice or Bob can cheat each other, because they have identical keys.
Example: Alice can claim that she never ordered a TV on-line from Bob (he could
have fabricated her order). To prevent this: „non-repudiation“
7/29 Chapter 6 of Understanding Cryptography by Christof Paar and Jan Pelzl
Content of this Chapter
New Idea:
1976: first publication of such an algorithm by Whitfield Diffie and Martin Hellman,and
also by Ralph Merkle.
During the key generation, a key pair Kpub and Kpr is computed
(Kpub) (Kpr)
• Alice deposits (encrypts) a message with the - not secret - public key Kpub
• Only Bob has the - secret - private key Kpr to retrieve (decrypt) the message
Alice Bob
KpubB (KpubB,KprB) = K
x
y=eKpubB(x) y
x=dKprB(y)
*) at least for now; public keys need to be authenticated, cf.Chptr. 13 of Understanding Cryptogr.
13/29 Chapter 6 of Understanding Cryptography by Christof Paar and Jan Pelzl
Security Mechanisms of Public-Key Cryptography
Here are main mechanisms that can be realized with asymmetric cryptography:
1. Key exchange (for symmetric schemes) and digital signatures are performed
with (slow) asymmetric algorithms
2. Encryption of data is done using (fast) symmetric ciphers, e.g., block ciphers
or stream ciphers
Alice Bob
(KpubB,KprB) = K
KpubB
Choose random
symmetric key K Key Exchange
(asymmetric)
y1 = eKpubB(K) y1
K = dKprB(y1)
y2 (symmetric)
y2 = AESK (x) x = AES-1K (y2)
16/29 Chapter 6 of Understanding Cryptography by Christof Paar and Jan Pelzl
Content of this Chapter
Note: The problems are considered mathematically hard, but no proof exists (so far).
18/29 Chapter 6 of Understanding Cryptography by Christof Paar and Jan Pelzl
Key Lengths and Security Levels
• Compute the greatest common divisor gcd (r0, r1) of two integers r0 and r1
• Example:
r0 = 84 = 2 . 2 . 3 . 7
r1 = 30 = 2 . 3 . 5
• Note that gcd (r0, r1) = 1 in order for the inverse to exist
Example:
• Calculate the modular Inverse of 12 mod 67:
• From magic table follows
• Hence 28 is the inverse of 12 mod 67.
For the full Extended Euclidean Algorithm see Chapter 6 in Understanding Cryptography.
• Testing one gcd per number in the set is extremely slow for large m.
25/29 Chapter 6 of Understanding Cryptography by Christof Paar and Jan Pelzl
Euler‘s Phi Function 2/2
Example: a = 2, p = 7
• Fermat‘s Little Theorem works only modulo a prime p
• Euler’s phi function gives us the number of elements smaller than an integer
n that are relatively prime to n. This is important for the RSA crypto scheme.