What will be the ciphered text if the string "HELLO" is given as input to the code of hill cipher with keyword as "DATASTRUCTURE"?
A. VFBH
B. VFBJ
C. VFBK
D. VFBM
Answer: Option A
Solution (By Examveda Team)
Hill Cipher: The Hill cipher is a polygraphic substitution cipher based on linear algebra. It uses matrix multiplication for encryption.Given:
Plaintext: "HELLO"
Keyword: "DATASTRUCTURE"
Steps to Encrypt Using Hill Cipher:
Step 1: Convert the keyword "DATASTRUCTURE" into a matrix. The matrix size is determined by the length of the keyword. For simplicity, assume a 2x2 matrix is used for a 2-letter cipher.
Using the first 4 letters of the keyword "DATA" we get:
D=3, A=0, T=19, A=0
Matrix: [ [3, 0], [19, 0] ]
Step 2: Convert the plaintext "HELLO" into numerical values (H=7, E=4, L=11, L=11, O=14) and arrange them into 2-letter pairs:
HE = [7, 4]
LL = [11, 11]
LO = [11, 14]
Step 3: Multiply each pair by the matrix and take modulo 26 to get the encrypted values:
For HE:
Matrix * [7, 4] = [3*7 + 0*4, 19*7 + 0*4] = [21, 133]
Modulo 26:
[21, 133 mod 26 = 5] = [21, 5] = [V, F]
For LL:
Matrix * [11, 11] = [3*11 + 0*11, 19*11 + 0*11] = [33, 209]
Modulo 26:
[33 mod 26 = 7, 209 mod 26 = 1] = [H, B]
For LO:
Matrix * [11, 14] = [3*11 + 0*14, 19*11 + 0*14] = [33, 209]
Modulo 26:
[33 mod 26 = 7, 209 mod 26 = 1] = [H, B]
Conclusion: The encryption results in the ciphered text being "VFBH" when the plaintext "HELLO" is processed using the Hill cipher with the keyword "DATASTRUCTURE".
Join The Discussion