Practical Cryptology, IT754A, 7,5hp: Instruction
Practical Cryptology, IT754A, 7,5hp: Instruction
Practical Cryptology, IT754A, 7,5hp: Instruction
Home-take Examination 3
Instruction
This home-exam must be done individually. Copying others complete or partial
work is strictly prohibited. You may, of course, discuss the problems with fellow
students and/or teachers, but you should work on the solutions independently.
If you use a computer program to solve some tasks, a program listing together with
the documentation of the program code should be provided as Appendix.
1
Examination tasks
1. (a) Use Millar-Rabin test to show that n = 533213193 is not prime.
(b) Alice use RSA to send the following message to Bob.
3783 2249 504 3882 6486 3783 1791 77 3135 3783 1791 1180.
During encryption, Alice used Bobs public key kpub = (n, e) = (6497, 223), the
ordering of English alphabets a ↔ 31, b ↔ 32, . . . , z ↔ 56 and encrypts each
letter separately. Oscar wants to attack the ciphertext without factorizing n.
You task is also to find the plaintext without factoring n. (3 pts/task)
2. The integer n = 4304177 is a product of two primes p and q.
(a) Use Pollard-p − 1 method to factorize n. Compute also φ(n).
(b) Choose a suitable encryption exponent e and find the corresponding decryption
exponent d. Motivate your choice of e.
(c) Use your key to encrypt a plaintext of your choice containing at least ten En-
glish alphabets and the ordering a ↔ 01, b ↔ 02, . . . , z ↔ 26. The encryption
should be done in a block of length three. (2 pts/task)
3. In practice, it is customary to select a relatively small encryption exponent e that
give rise to a relatively large decryption exponent d. Such a choice leads to a
relatively fast encryption process, but a relatively slow decryption process. One
way of speeding up the decryption process is using the Chinese Remainder Theorem
(CRT).
The process goes like this:
Input: p, q, e, d and the ciphertext y = xe (mod n).
Output: We want to compute plaintext x = y d (mod n)).
Compute yp ≡ y (mod p) and yq ≡ y (mod q)
Compute dp ≡ d (mod p − 1) and dq ≡ d (mod q − 1).
d d
Compute xp ≡ yp p (mod p) and xq ≡ yq q (mod q).
Compute the inverse cp of q modulo p and the inverse cq of p modulo q
Finally the ciphertext will be x = (qcp xp + pcq xq ) (mod n).
Your task is to decrypt the ciphertext y = 34818 31433 13755 that was encrypted
by RSA with public key kpub = (n, e) = (40633, 547). The ciphertext is generated
by using English alphabets and the ordering a ↔ 01, b ↔ 02, . . . , z ↔ 26. Tasks to
do.
(a) Use Fermat’s Factorization method to factorize n. (2 pts)
(b) Compute the decryption exponent d. (1 pt)
(c) Follow the above procedure to decrypt the ciphertext by using the Chinese
Remainder Theorem. (3 pts)
4. (a) Find all the primitive elements of F∗37 . (1 pts)
(b) Use Baby step-Giant step to solve the DLP
39x ≡ 217 (mod 383).
(2 pts)
2
(c) Use Pohlig-Hellman algorithm to solve the DLP
(3 pts)
5. (a) Alice and Bob want to have a secrete four-digit access code for their Cryptology
lab door that they share. They both decided to use Diffie-Hellman protocol
with the public keys (p, g) = (9001, 13). Alice chose her private key to be
x = 347. Find the private key Bob chooses so that the access code to the lab
is 8962.
(b) In the ElGamal cryptosystem, Alice and Bob use the prime number p = 17
and a primitive root g = 3 modulo 17. Bob chooses his secret to be a = 6, so
α = 36 (mod 17) = 15. Alice sends the ciphertext (β, y) = (7, 6). Determine
the plaintext x. (3 pts/task)
(a) Show that the point (1, 5) lies on the curve. (1 pt)
(b) Find an integer k such that k(1, 5) = (9, 3). (2 pts)
(c) Use the Double-and-Add algorithm to compute 17(1, 5). (2 pts)
7. For this task we consider the ELGamal signature scheme. We are given a prime
p = 113 and a primitive element g = 67 ∈ Zp . You are given Bob’s private key
d = 97 and the corresponding public key kpub = (p, g, β) where β = g d (mod p).
(a) Calculate the ELGamal signature (r, s) and the corresponding verification
forthe message x = 83 sent from Bob to Alice using ephemeral key kE = 59.
(2 pts)
(b) Alice thought that she received the messages (x1 , r1 , s1 ) = (38, 12, 77) and
(x2 , r2 , s2 ) = (72, 92, 76) from Bob. Help Alice verify whether these messages
originated actually from Bob. (3 pts)