CryptoCompre2021 KEY
CryptoCompre2021 KEY
Hyderabad Campus
nd
2 Semester 2020-2021
Cryptography (BITS F463) – Comprehensive Examination (Regular) - KEY
Q1. (a) Given the ElGamal Crypto system for public key encryption. Two users A and B agree on
a prime number p = 17 and a generator value g = 6.
(b)
The user B chooses a random integer b, and publishes the point bG (while b remains secret)
The user A chooses his own random integer a and sends the pair of points (aG, Pm+a(bG))) to the
user B (while a remains secret).
Now to decrypt the message, the user B computes b(aG) from the first part of the pair, then subtracts it
from the second part to obtain Pm+a(bG)−b(aG) = Pm+abG−abG = Pm, and then reverses the
embedding to get back the message M.
Let us say an attacker E, who can only see the values bG, aG, and Pm + a(bG) will have to find a from
aG or b from bG to make sense of Pm + a(bG). As the problem is now reduced to the Elliptic Curve
Discrete Log Problem, the attack can be thwarted.
Q2. (a) The plaintext message is “The office did not jump at the idea”. The Playfair key matrix
used by User A to encrypt the plaintext message is
A B C D E
F G H I/J K
L M N O P
Q R S T U
V W X Y Z
Given that to break up a similar letter pair, we need to use the letter X. If the number of letters in
the plaintext message is not sufficient to make pairs of letters, then we need to add the letter X at
the end of the message so that it is of even length.
TH EO FX FI CE DI DN OT IU MP AT TH EI DE AX
Now, applying the Playfair cipher encryption, applying the rules, we get the corresponding
ciphertext as:
SI DP HV GK DA IO CD TY KT NL DQ CD DK EA CV
(b) Given a 2 x 2 Hill Cipher encryption with key matrix as a 2 x 2 matrix whereas the plaintext to
be encrypted is split into digraphs and is written as numeric column vectors.
The key matrix is:
By applying the rules of the Hill cipher algorithm, we can find out the cipher text as:
We multiply the key matrix by each column vector in turn. That is,
We can now convert these numbers to letters, so 0 becomes A and 15 becomes P. Thus the first
two letters of the ciphertext are AP.
letter A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
cipher C R Y P T O G A H B D E F I J K L M N Q S U V W X Z
(b)
The new state matrix after we have completed the operation can be obtained by XOR-ing the
corresponding entries of the above two matrices.
(i) S1(100011)
When we write the first and the sixth bits together, we get 11 in binary, which is 3 in decimal. The
remaining bits are 0001 in binary, which is 1 in decimal. Now, we look for the value in row 3,
column 1, in the S1 box. The result is 12 in decimal, which is 1100 in binary.
Thus the input 100011 yields the output 1100.
(ii) S8 (000000)
When we write the first and the sixth bits together, we get 00 in binary, which is 0 in decimal. The
remaining bits are 0000 in binary, which is 0 in decimal. Now, we look for the value in row 0,
column 0, in the S8 box. The result is 13 in decimal, which is 1101 in binary.
Thus the input 000000 yields the output 1101.