TMA4155 – exercise 3

2011-10-03

1 — Hill cipher in CBC mode

Encrypt the word banana Using the classical Hill cipher in CBC mode with a 26-letter alphabet: A=0, B=1, …, Z=25. The key is the \(2\times2\) matrix \[M=\begin{pmatrix}4&1\\3&7\end{pmatrix}.\] Use the initialization vector \((11,2)\). Where the standard description of CBC mode calls for bitwise XOR (which is really addition modulo 2), use componentwise addition modulo 26 instead. Write the answer using letters of the alphabet, not forgetting the IV.

Next, decrypt the message OJXIBQ using the same key, again with CBC mode (the initialization vector is included in the ciphertext, so the plaintext is only four letters long).

2 — Factors

Show that if \(91\mid a_1a_2\cdots a_n\) then \(7\mid a_i\) for at least one \(i\).

3 - Diffie–Hellman key exchange

Alice and Bob have secret DH keys \(a=33\) and \(b=17\) respectively. Their version of the Diffie–Hellman key exchange protocol uses the prime \(p=101\) with generator \(g=2\). Compute the public keys \(A\) and \(B\) of Alice and Bob, as well as their shared secret.

4 – RSA cryptosystem

  • (a) Given \(p = 31\), \(q = 43\) and \(e = 11\), complete the key generation (that is, find \(n\) and \(d\)).
  • (b) Encrypt \(m = 3\).
  • (c) Decrypt \(c = 2\).

5 – Double RSA encryption

Alice and Bob want to improve the security of their RSA system. Instead of using one encryption key they want to use two keys \((n,e_1)\) and \((n,e_2)\) (the same \(n\)), and to encrypt twice, first using \((n,e_1)\) and then \((n,e_2)\). They think that this is more secure and even believe that it is possible with this method to gain speed by using a much smaller \(n\), but keeping the level of security. Are they right?

6 – RSA

Exercise 7, page 193 in T&W

2011-09-27, Harald Hanche-Olsen