Sunteți pe pagina 1din 3

Assignment 1 (submit by September 13, 2019)

1. (a) The Vigenere cipher is used with key “rocket” to encrypt the message “the phone
is bugged”. Find the ciphertext.
(b) Decrypt the ciphertext “DZGIFZUOPVYYPXJYACTIXQTYGJ” that came from
the Vigenere cipher with key “bluefog”.

2. (a) The Playfair cipher is used with keyword “crimson” to encrypt the message
“spread out your team”. Find the ciphertext.
(b) Decrypt the ciphertext “YTFCGCIDIOCHINRAYTFCKCPMAVBC” that came
from the Playfair cipher of part (a).

3. Use the Hill cipher with encryption matrix


 
5 2 9
A =  −4 2 3 
3 −1 −5

(a) to encrypt the message “this hotel is safe”.


(b) to decrypt the message “URMSCSWQKUBY”

4. Suppose you are told that the plaintext “breathtaking” yields the ciphertext
“RUPOTENTOIFV” where the Hill cipher is used (but m is not specified). Determine
the encryption matrix.

5. Perform the modular exponentiation 171236 (mod47) using


(a) Fast Modular Exponentiation, (b) Fermat’s little theorem.
(Write your answer as an integer in {1, 2, . . . , m − 1}, if you are working modulo m.)

6. Use Euler’s theorem to compute the modular exponentiation 222970 (mod25).


(Write your answer as an integer in {1, 2, . . . , m − 1}, if you are working modulo m.)

7. Compute each of the following orders, if they exist: (a) ord11 (3), (b) ord21 (6), (c)
ord304 (21).

8. For n = 81, do the following:

(a) Determine whether there are any primitive roots mod n = 81; if so, how many
will there be?
(b) If there are primitive roots mod n = 81, find the smallest one.
(c) If there are primitive roots, use the one you found in (b) to construct another.

9. (a) Verify that g = 3 is a primitive root of 223.


(b) How many integers mod 223 have order 6? If such elements exist, find one.
(c) How many integers mod 223 have order 74? If such elements exist, find one.
(d) How many integers mod 223 have order 10? If such elements exist, find one.
——-P.T.O.———
10. You are given the following parameters for the Diffie Hellman Key Exchange algorithm:

Prime p = 773
Primitive root g =2
User Alice selects private key a = 333
User Bob selects private key b = 603

Write each answer as an integer in {1, 2, . . . , m − 1}, if you are working modulo m.

(i) Show that g = 2 is indeed a primitive root of q = 773.


(ii) Compute the number A that Alice (publicly) sends Bob, and the number B that
Bob sends Alice.
(iii) Compute the shared Diffie-Hellman key for Alice and Bob in two different ways,
as would be done on Alice’s end and on Bob’s end.

11. Suppose that Bob adopts the RSA cryptosystem with primes p = 43 and q = 73. He
chooses the (public key) encryption exponent to be e = 1195. Write each answer as an
integer in {1, 2, . . . , m − 1}, if you are working modulo m.

(a) Show that Bob’s choice of encryption exponent is legitimate, and find his corresponding
(private key) decryption exponent d.
(b) Suppose that Alice encrypts the plaintext message P = 1234 using the RSA
cryptosystem with Bob’s public key (n, e) = (3139, 1195). What is the resulting
ciphertext that would be sent to Bob?
(c) Go through the decryption process that would need to be done at Bob’s end, using
his private key (n, d) with decryption exponent that was determined in part (a).

12. (a) Use the prime number theorem to estimate the number of 1000-bit primes.
This will be the number of primes between 2999 and 21000 .
(b) If we randomly pick a 1000-bit odd integer, estimate the probability that it will
be prime.

13. Suppose that Alice and Bob decide to communicate with an ElGamal cryptosystem
using the prime p = 8263 and individual keys a = 856 and b = 3127, and using the
smallest primitive root g of p that satisfies g > 1700. Write each answer as an integer
in {1, 2, . . . , m − 1}, if you are working modulo m.

(a) Determine the primitive root g.


(b) Compute the ciphertext in this system if Alice sends Bob the message P = 4321.
(c) Perform the ElGamal decryption process that would need to get done at Bob’s
end to decrypt Alice’s message.
——-P.T.O.———
14. Suppose that Bob uses the Markle-Hellman knapsack cryptosystem with superincreasing
sequence [a1 , a2 ,P
a3 , a4 , a5 , a6 , a7 , a8 , a9 ] = [1, 2, 6, 10, 25, 55, 105, 205, 505], m = 999 (which
is greater than i ai ), and w = 334 (which is relatively prime to m).

(a) What is Bob’s public key?


(b) If Alice uses Bob’s public key to encrypt the plaintext 101010101, determine the
resulting ciphertexts.
(c) Perform the decryption process that would need to be done when Bob receives
the ciphertext of part (b).

15. Find all solutions for each of the following congruences (use extended Euclidean
algorithm): (a) 6x ≡ 28 (mod 776), (b) 15x ≡ 21 (mod 1940).

16. Find all square √


roots (if they exist)
√ of the following√(Use Chinese Remainder
Theorem): (a) 5 (mod 413), (b) 11 (mod 26), (c) 68 (mod 86).

17. Given that 1111118111111 is a prime, determine whether 1001 is a quadratic residue
(mod 1111118111111).
1234567

18. Compute the Jacobi symbol 11111111 without any factoring, other than dividing out
powers of two.

19. Let n = 713 be a Rabin modulus and let c = 289 be a ciphertext that is obtained by
Rabin encryption using this modulus. Determine all possible plaintexts.

——-The End———