26-Practice Problems-14-03-2024

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

• RSA

• Diffie-Hellman Key Exchange


• Elgamal Cryptographic System
• Elliptic Curve cryptography
Exercise
1. Perform encryption and decryption using the RSA algorithm, for
the following:
a. p = 3; q = 11, e = 7;M = 5
b. p = 5; q = 11, e = 3;M = 9
c. p = 7; q = 11, e = 17;M = 8
d. p = 11; q = 13, e = 11;M = 7
e. p = 17; q = 31, e = 7;M = 2
2. In a public-key system using RSA, you intercept the ciphertext C =
10 sent to a user whose public key is e = 5, n = 35. What is the
plaintext M?
3. In an RSA system, the public key of a given user is e = 31, n = 3599.
What is the private key of this user? Hint: First use trial-and-error
to determine p and q; then use the extended Euclidean algorithm
to find the multiplicative inverse of 31 modulo φ(𝑛).
Exercise
4. In RSA algorithm, find d if you know that e = 17 and n = 187.
5. In RSA, given e = 13 and n = 100
• encrypt the message “HOW ARE YOU” using 00 to 25 for letters A to Z
and 26 for the space. Use different blocks to make P < n.
6. Alice uses Bob’s RSA public key (e = 17, n = 19519) to send a
four-character message to Bob using the (A 0, B 1, … Z
25) encoding scheme and encrypting each character
separately. Eve intercepts the ciphertext (6625 0 2968 17863)
and decrypts the message without factoring the modulus.
Find the plaintext and explain why Eve could easily break the
ciphertext.
7. Alice uses Bob’s RSA public key (e = 3, n = 35) and sends the
ciphertext 22 to Bob. Show how Eve can find the plaintext
using the cycling attack.
Problems
Problems
Problems

1. In ElGamal, given the prime q = 31:


a. Choose an appropriate 𝑎 and XB, then calculate YB.
b. Encrypt the message “HELLO”; use 00 to 25 for encoding. Use different
blocks to make P < p.
c. Decrypt the ciphertext to obtain the plaintext.
2. Assume that Alice uses Bob’s ElGamal public key (𝑎 = 2 and YB = 8) to send
two messages P = 17 and P′ = 37 using the same random integer r = 9. Eve
intercepts the ciphertext and somehow she finds the value of P = 17. Show
how Eve can use a known-plaintext attack to find the value of P′.
Problem
1. What is the discrete logarithm of Q(-0.35,2.39) to
the base P(-1.65,-2.79) in the elliptic curve group
𝑦2 = 𝑥3 − 5𝑥 + 4 over real numbers?
ElGamal cryptosystem using the elliptic curve
• 𝑴 = (𝟐𝟒, 𝟐𝟔)
• B’s key Generation
• Global values 𝑃 = 67; 𝐸67(2,3); 𝐺 = 2, 22 ;
• Private key: 𝑛𝐵 = 4
• User A: Encryption
• Select K= 2
ElGamal cryptosystem using the elliptic curve
• User A wants to send a message to B 𝑴 = (𝟐𝟒, 𝟐𝟔)
• B’s key Generation
• Global values 𝑃 = 67; 𝐸67(2,3); 𝐺 = 2, 22 ;
• Private key: 𝑛𝐵 = 4
• Public Key: 𝑃𝐵 = 4 ∗ 2,22 = (13,45)
• User A: Encryption
• Select K= 2
• 𝐶 = {𝑘𝐺, 𝑀 + 𝑘𝑃𝐵 }
• 𝐶1 = 𝑘𝐺 = 2 ∗ 2,22
• 𝐶1 = (35,1)
• 𝐶2 = 23,25 + 2 13,45
• 𝐶2 = (21,44)
• 𝐶 = {(35,1), (21,44)}
ElGamal cryptosystem using the elliptic curve
• Decrypt the ciphertext at User B
• 𝐶 = {(35,1), (21,44)}
• 𝑀 + 𝑘𝑃𝐵 − 𝒏𝑩(𝑘𝐺)=𝐶2 − 𝒏𝑩(𝐶1)
• (21,44) − 4(35,1)
• (21,44) − (23,25)
• (21,44) + (23,42)
• (24,26)
Problems
Problems

1. In the elliptic curve E(1, 2) over the GF(11) field:


a. Find the equation of the curve.
b. Find all points on the curve and plot them.
c. Generate public and private keys for Bob.
d. Choose a point on the curve as a plaintext for Alice.
e. Create ciphertext corresponding to the plaintext in part d for Alice.
f. Decrypt the ciphertext for Bob to find the plaintext sent by Alice.
2. In the elliptic curve E(g4, 1) over the GF(24) field:
a. Find the equation of the curve.
b. Find all points on the curve and plot them.
c. Generate public and private keys for Bob.
d. Choose a point on the curve as a plaintext for Alice.
e. Create ciphertext corresponding to the plaintext in part d for Alice.
f. Decrypt the ciphertext for Bob to find the plaintext sent by Alice.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy