Ch4-PublicKeyCryptography
Ch4-PublicKeyCryptography
Ch4-PublicKeyCryptography
net/publication/371641373
CITATIONS READS
0 1,143
1 author:
Asmelash Girmay
Mekelle University
6 PUBLICATIONS 1 CITATION
SEE PROFILE
All content following this page was uploaded by Asmelash Girmay on 19 June 2023.
Asmelash Girmay
Department of Information Technology
Public Key Cryptography
Also known as asymmetric cryptography – RSA, Diffie-Hellman, ElGamal, ECC
Introduction
• Public key cryptography also know as two-keys cryptography or asymmetric
cryptography
• This type of cryptography can be used for confidentiality, authentication or both.
• It has two keys
1. Public key – it is known by anyone. It’s used for message encryption and signature
verifications
2. Private key – known only by the owner. It’s used for message decryption and signature
creation (signing)
Confidentiality Authentication
Confidentiality
• Once secret key is exchanged using Diffie-Helman, communicating parties can use
secret-key cryptography for communications.
• The limitation with this algorithm is that it doesn’t have an authenticating.
• Dear Bob, I’d like our prime to be 128903289023 and g to be 23489. Love, Alice
• The ElGamal public key consists of the • Thus, the public key is {17, 6, 7}
three parameters n, g, y. • And, private key is {5, 17}
Encryption Example
• Use the public key (n, g, y) of the • Using the public key {17, 6, 7}
other party to encrypt messages. • K = 10 and plaintext, P < n. P = 13
• Sender represents the plaintext as a • C1 = 610 mod 17
series of numbers modulo n. • C1 = 15
• Randomly generate a number k; • C2 = (13*710) mod 17
Compute two values C1 and C2: • C2 = 9
• C1 = gk mod n
• Send C = C1, C2 = 15, 9.
• C2 = (P*yk) mod n
• Send the ciphertext C = C1, C2
Decryption Example
• Two steps to decrypt the ciphertext C • Using the private key {5, 17} and recieved
= C1, C2 using the private key, x: ciphertext C = C1, C2 = 15, 9:
• First calculate (C1)-x mod n
• To get the Plaintext, P
• 15-5 mod 17 = r*155 = 1 (mod 17)
• P = C2 × (C1)-x mod n
• Find r,
• P= [((C1)-x mod n) * C2] mod n • r = 1, 155 mod 17 = 2. No!
• (C1)-x mod n is a modular inverse of (C1)x • r = 2, 2*155 mod 17 = 4. No! …
mod n. It is called decryption factor. • r = 9, 9*155 mod 17 = 1. Yes!
• It can be calculated as: • P = C2 * r mod 11 = 9*9 mod 17
• r* (C1)x = 1 (mod n). Find r. • P = 81 mod 11 = 13!
• Collision resistance
• It is hard to find any x, x’ such that h(x) = h(x’)
• Avalanche effect
• When an input changes slightly, the output changes
significantly
2. Hash chains
1
3. Hash trees
4. Checksums 3 2
• Challenge
Response
Authentication
Mechanism
(CRAM)
b
a
d
c
Key:
M= input message
C = MAC function
K = shared secret key