����ASYMMETRIC CIPHERS: Principles of Public-Key Cryptosystems, The �RSA algorithm, Diffie - Hellman Key Exchange, Elliptic Curve Arithmetic,�Elliptic Curve Cryptography �(Text 1: Chapter 8, Chapter 9: Section 1, 3, 4)��Text Books:�1. William Stallings , “Cryptography and Network Security Principles and Practice”, � Pearson Education Inc., 6th Edition, 2014, ISBN: 978-93-325-1877-3�2. Bruce Schneier, “Applied Cryptography Protocols, Algorithms, and Source code � in C”, Wiley Publications, 2nd Edition, ISBN: 9971-51-348-X.� � Reference Books: �1. Cryptography and Network Security, Behrouz A. Forouzan, TMH, 2007.�2. Cryptography and Network Security, Atul Kahate, TMH, 2003. ��
MODULE 4
*
2
Asymmetric Key Encryption
Diffie and Hellman
*
3
*
4
Conventional Encryption | Public-Key Encryption |
Needed to Work: | Needed to Work: |
|
|
Needed for Security: | Needed for Security: |
|
|
*
5
Y = E(PUb, X)
X = D(PRb, Y)
*
6
Y = E(PRa, X) X = D(PUa, Y)
*
7
Z = E(PUb, E(PRa, X)) X = D(PUa, E(PRb, Z))
*
8
*
9
Requirements for Public-Key Cryptography
1. It is computationally easy for a party B to generate a pair (public key PUb,
private key PRb).
2. It is computationally easy for a sender A, knowing the public key and the
message to be encrypted, M, to generate the corresponding ciphertext:
C = E(PUb, M)
3. It is computationally easy for the receiver B to decrypt the resulting
ciphertext using the private key to recover the original message:
M = D(PRb, C) = D[PRb, E(PUb, M)]
4. It is computationally infeasible for an adversary, knowing the public key,
PUb, to determine the private key, PRb.
5. It is computationally infeasible for an adversary, knowing the public key,
PUb, and a ciphertext, C, to recover the original message, M.
We can add a sixth requirement that, although useful, is not necessary for all public-key applications:
6. The two keys can be applied in either order:
M = D[PUb, E(PRb, M)] = D[PRb, E(PUb, M)]
*
10
The RSA (Ron Rivest, Adi Shamir, and Len Adleman) Algorithm 1977
C = Me mod n
M = Cd mod n = (Me)d mod n = Med mod n
For this algorithm to be satisfactory for public-key encryption, the following requirements must be met:
Med mod n = M
The preceding relationship holds if e and d are multiplicative inverses modulo φ(n), where φ(n) is the Euler totient function.
For p, q prime, φ(pq) = (p -1)(q-1) The relationship between e and d can be expressed as
*
11
That is, e and d are multiplicative inverses mod f(n). Note that, according to the rules of modular arithmetic, this is true only if d (and therefore e) is relatively prime to f(n).
Equivalently, gcd(f(n),d) = 1.
*
12
*
13
Two numbers are relatively prime if they have no prime factors in common; that is, their only common divisor is 1. This is equivalent to saying that two numbers are relatively prime if their greatest common divisor is 1.
*
14
EXTENDED EUCLID(f(ɸ), e)
4. Q = A3
B3
5. (T1, T2, T3) 🡨(A1-QB1, A2-QB2, A3-QB3)
6. (A1, A2, A3) 🡨(B1, B2, B3)
7. (B1, B2, B3) 🡨(T1, T2, T3)
8. Goto 2
If gcd(f(ɸ), e) = 1, then e has a multiplicative inverse modulo f(ɸ).
That is, for positive integer b < f(ɸ), there exists a e1 < f(ɸ) such that ee1 = 1 mod f(ɸ). The Euclidean algorithm can be extended so that, in addition to finding gcd(f(ɸ), e), if the gcd is 1, the algorithm returns the multiplicative inverse of e.
*
15
Diffie–Hellman key exchange
First, we define a primitive root of a prime number p as one whose powers modulo p generate all the integers from 1 to p-1. That is, if a is a primitive root of the prime number p, then the numbers
a mod p, a2 mod p,..., ap-1 mod p
are distinct and consist of the integers from 1 through p-1 in some permutation.
For any integer b and a primitive root a of prime number p, we can find a unique exponent i such that
Used for sharing a secret key
*
16
The number 3 is a primitive root modulo 7 because
*
17
The Algorithm
*
18
*
19
K | = (YB)XA mod q |
|
| = (aXB mod q)XA mod q |
|
| = (aXB)XA mod q | by the rules of modular arithmetic |
| = (aXB XA mod q |
|
| = (aXA)XB mod q |
|
| = (aXA mod q) |
|
| = (aXA mod q)XB mod q |
|
| = (YA)XB mod q | |
*
20
*
21
Elliptic Curve Cryptography
Real Elliptic Curves
Real Elliptic Curve Example
Finite Elliptic Curves
Elliptic Curve Cryptography
ECC Diffie-Hellman
ECC Encryption/Decryption
Pm+kPb–nB(kG) = Pm+k(nBG)–nB(kG) = Pm
ECC Security
Comparable Key Sizes for Equivalent Security
Symmetric scheme (key size in bits) | ECC-based scheme (size of n in bits) | RSA/DSA (modulus size in bits) |
56 | 112 | 512 |
80 | 160 | 1024 |
112 | 224 | 2048 |
128 | 256 | 3072 |
192 | 384 | 7680 |
256 | 512 | 15360 |