Unit 3 - Asymmetric Key Cryptography
Unit 3 - Asymmetric Key Cryptography
1
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
Euler’s Phi-Function
Euler’s phi-function, φ(n), which is sometimes called the Euler’s totient
function plays a very important role in cryptography. The function finds the
number of integers that are both smaller than n and relatively prime to n.
The following helps to find the value of φ(n).
1. φ(1) = 0.
2. φ(p) = p − 1 if p is a prime.
3. φ(m × n) = φ(m) × φ(n) if m and n are relatively prime.
2
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
2) Euler’s Theorem
Euler’s theorem can be thought of as a generalization of Fermat’s little theorem.
The modulus in the Fermat theorem is a prime, the modulus in Euler’s theorem
is an integer.
First Version
The first version of Euler’s theorem is similar to the first version of the Fermat’s
little theorem. If a and n are coprime, then aφ(n) ≡ 1 (mod n).
Second Version
The second version of Euler’s theorem is similar to the second version of
Fermat’s little theorem; it removes the condition that a and n should be coprime.
If n = p × q, a < n, and k an integer, then ak × φ(n) + 1 ≡ a (mod n).
3
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
SYMMETRIC-KEY AGREEMENT
Alice and Bob can create a session key between themselves without using a
KDC. This method of session-key creation is referred to as the symmetric-key
agreement.
Although there are several ways to accomplish this, one common method is
Diffie-Hellman .
4
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
5
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
>RSA
The most common public-key algorithm is the RSA cryptosystem, named for its
inventors (Rivest, Shamir, and Adleman).
Introduction
RSA uses two exponents, e and d, where e is public and d is private.
Suppose P is the plaintext and C is the ciphertext. Alice uses C = Pe mod n to
create ciphertext C from plaintext P;
Bob uses P = Cd mod n to retrieve the plaintext sent by Alice.
The modulus n, a very large number, is created during the key generation
process,
Example:
1. Select two prime numbers, p = 17 and q = 11.
2. Calculate n = p*q = 17 * 11 = 187.
3. Calculate f(n) = (p - 1)(q - 1) = 16 * 10 = 160.
4. Select e such that e is relatively prime to f(n) = 160 and less than f(n); we
choose e = 7.
5. Determine d such that de K 1 (mod 160) and d 6 160. The correct value is
d = 23, because 23 * 7 = 161 = (1 * 160) + 1; d can be calculated using the
extended Euclid’s algorithm.
The example shows the use of these keys for a plaintext input of M = 88.
6
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
6. C = Me mod n
C = 88 7 mod 187.
C= 11
7. For decryption, M = C d mod n
we calculate M = 112 3 mod 187
M= 88
Example:
7
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
8
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
In contrast to RSA, ECC bases its approach to public key cryptographic systems
on how elliptic curves are structured algebraically over finite fields. Therefore,
ECC creates keys that are more difficult, mathematically, to crack. For this
reason, ECC is considered to be the next generation implementation of public
key cryptography and more secure than RSA.
It also makes sense to adopt ECC to maintain high levels of both performance
and security. That’s because ECC is increasingly in wider use as websites strive
for greater online security in customer data and greater mobile optimization,
simultaneously.
9
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
KA = nA * PB
KB = nB * PA
ECC Encryption:
ECC Decryption:
For decryption multiply 1st point in the pair with receiver’s secret key
i.e KG * nB
10
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
Verification Method
For a digital signature, the recipient receives the message and the
signature.A copy of the signature is not stored anywhere. The recipient
needs to apply a verification technique to the combination of the message
and the signature to verify the authenticity.
Relationship
For a conventional signature, there is normally a one-to-many relationship
between a signature and documents. A person uses the same signature to
sign many documents.
For a digital signature, there is a one-to-one relationship between a
signature and a message. Each message has its own signature. The
signature of one message cannot be used in another message. If Bob
receives two messages, one after another, from Alice, he cannot use the
11
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
signature of the first message to verify the second. Each message needs a
new signature.
Process:
The sender uses a signing algorithm to sign the message. The message and
the signature are sent to the receiver. The receiver receives the message
and the signature and applies the verifying algorithms to the combination.
If the result is true, the message is accepted; otherwise, it is rejected.
In a digital signature, the signer uses her private key, applied to a signing
algorithm, to sign the document. The verifier, on the other hand, uses the
public key of the signer, applied to the verifying algorithm, to verify the
document.
A digital signature needs a public-key system. The signer signs with
her private key; the verifier verifies with the signer’s public key.
12
Prof. Andleeb Sahar
UNIT III CRYPTOGRAPHY & NETWORK SECURITY
3.Non Repudiation
If in the future Alice denies that she sent the message, the center can show
a copy of the saved message. If Bob’s message is a duplicate of the
message saved at the center, Alice will lose the dispute.
Nonrepudiation can be provided using a trusted party.
4.Confidentiality
A digital signature does not provide confidential communication.
13
Prof. Andleeb Sahar