MMTE-006 Solved Assignment 2024 CS
CRYPTOGRAPHY
(January 31st, 2024 – December 31st, 2024)
a) Let
f
(
x
)
=
x
3
−
x
−
1
∈
Z
5
[
x
]
f
(
x
)
=
x
3
−
x
−
1
∈
Z
5
[
x
]
f(x)=x^(3)-x-1inZ_(5)[x] f(x)=x^3-x-1 \in \mathbf{Z}_5[x] f ( x ) = x 3 − x − 1 ∈ Z 5 [ x ] . Find the product of
x
2
+
2
x
+
1
+
(
f
(
x
)
)
x
2
+
2
x
+
1
+
(
f
(
x
)
)
x^(2)+2x+1+(f(x)) x^2+2 x+1+(f(x)) x 2 + 2 x + 1 + ( f ( x ) ) and
x
2
+
3
x
−
1
+
(
f
(
x
)
)
x
2
+
3
x
−
1
+
(
f
(
x
)
)
x^(2)+3x-1+(f(x)) x^2+3 x-1+(f(x)) x 2 + 3 x − 1 + ( f ( x ) ) using the algorithm in page 23, block 1. You should show all the steps as in example 11, page 22, block 1 .
b) Let
f
(
x
)
=
x
4
+
x
+
1
∈
F
2
[
x
]
f
(
x
)
=
x
4
+
x
+
1
∈
F
2
[
x
]
f(x)=x^(4)+x+1inF_(2)[x] f(x)=x^4+x+1 \in \mathbf{F}_2[x] f ( x ) = x 4 + x + 1 ∈ F 2 [ x ] . We represent the field
F
2
4
F
2
4
F_(2^(4)) \mathbf{F}_{2^4} F 2 4 by
F
2
[
x
]
/
(
f
(
x
)
)
F
2
[
x
]
/
(
f
(
x
)
)
F_(2)[x]//(f(x)) \mathbf{F}_2[x] /(f(x)) F 2 [ x ] / ( f ( x ) ) . Let us write
γ
=
x
+
(
f
(
x
)
)
γ
=
x
+
(
f
(
x
)
)
gamma=x+(f(x)) \gamma=x+(f(x)) γ = x + ( f ( x ) ) . The table of values is given below:
i
i
i i i
γ
i
γ
i
gamma ^(i) \gamma^i γ i
Vector
i
i
i i i
γ
i
γ
i
gamma ^(i) \gamma^i γ i
Vector
0
1
(
0
,
0
,
0
,
1
)
(
0
,
0
,
0
,
1
)
(0,0,0,1) (0,0,0,1) ( 0 , 0 , 0 , 1 )
8
γ
2
+
1
γ
2
+
1
gamma^(2)+1 \gamma^2+1 γ 2 + 1
(
0
,
1
,
0
,
1
)
(
0
,
1
,
0
,
1
)
(0,1,0,1) (0,1,0,1) ( 0 , 1 , 0 , 1 )
1
γ
γ
gamma \gamma γ
(
0
,
0
,
1
,
0
)
(
0
,
0
,
1
,
0
)
(0,0,1,0) (0,0,1,0) ( 0 , 0 , 1 , 0 )
9
γ
3
+
γ
γ
3
+
γ
gamma^(3)+gamma \gamma^3+\gamma γ 3 + γ
(
1
,
0
,
1
,
0
)
(
1
,
0
,
1
,
0
)
(1,0,1,0) (1,0,1,0) ( 1 , 0 , 1 , 0 )
2
γ
2
γ
2
gamma^(2) \gamma^2 γ 2
(
0
,
1
,
0
,
0
)
(
0
,
1
,
0
,
0
)
(0,1,0,0) (0,1,0,0) ( 0 , 1 , 0 , 0 )
10
γ
2
+
γ
+
1
γ
2
+
γ
+
1
gamma^(2)+gamma+1 \gamma^2+\gamma+1 γ 2 + γ + 1
(
0
,
1
,
1
,
1
)
(
0
,
1
,
1
,
1
)
(0,1,1,1) (0,1,1,1) ( 0 , 1 , 1 , 1 )
3
γ
3
γ
3
gamma^(3) \gamma^3 γ 3
(
1
,
0
,
0
,
0
)
(
1
,
0
,
0
,
0
)
(1,0,0,0) (1,0,0,0) ( 1 , 0 , 0 , 0 )
11
γ
3
+
γ
2
+
γ
γ
3
+
γ
2
+
γ
gamma^(3)+gamma^(2)+gamma \gamma^3+\gamma^2+\gamma γ 3 + γ 2 + γ
(
1
,
1
,
1
,
0
)
(
1
,
1
,
1
,
0
)
(1,1,1,0) (1,1,1,0) ( 1 , 1 , 1 , 0 )
4
γ
+
1
γ
+
1
gamma+1 \gamma+1 γ + 1
(
0
,
0
,
1
,
1
)
(
0
,
0
,
1
,
1
)
(0,0,1,1) (0,0,1,1) ( 0 , 0 , 1 , 1 )
12
γ
3
+
γ
2
+
γ
+
1
γ
3
+
γ
2
+
γ
+
1
gamma^(3)+gamma^(2)+gamma+1 \gamma^3+\gamma^2+\gamma+1 γ 3 + γ 2 + γ + 1
(
1
,
1
,
1
,
1
)
(
1
,
1
,
1
,
1
)
(1,1,1,1) (1,1,1,1) ( 1 , 1 , 1 , 1 )
5
γ
2
+
γ
γ
2
+
γ
gamma^(2)+gamma \gamma^2+\gamma γ 2 + γ
(
0
,
1
,
1
,
0
)
(
0
,
1
,
1
,
0
)
(0,1,1,0) (0,1,1,0) ( 0 , 1 , 1 , 0 )
13
γ
3
+
γ
2
+
1
γ
3
+
γ
2
+
1
gamma^(3)+gamma^(2)+1 \gamma^3+\gamma^2+1 γ 3 + γ 2 + 1
(
1
,
1
,
0
,
1
)
(
1
,
1
,
0
,
1
)
(1,1,0,1) (1,1,0,1) ( 1 , 1 , 0 , 1 )
6
γ
3
+
γ
2
γ
3
+
γ
2
gamma^(3)+gamma^(2) \gamma^3+\gamma^2 γ 3 + γ 2
(
1
,
1
,
0
,
0
)
(
1
,
1
,
0
,
0
)
(1,1,0,0) (1,1,0,0) ( 1 , 1 , 0 , 0 )
14
γ
3
+
1
γ
3
+
1
gamma^(3)+1 \gamma^3+1 γ 3 + 1
(
1
,
0
,
0
,
1
)
(
1
,
0
,
0
,
1
)
(1,0,0,1) (1,0,0,1) ( 1 , 0 , 0 , 1 )
7
γ
3
+
γ
+
1
γ
3
+
γ
+
1
gamma^(3)+gamma+1 \gamma^3+\gamma+1 γ 3 + γ + 1
(
1
,
0
,
1
,
1
)
(
1
,
0
,
1
,
1
)
(1,0,1,1) (1,0,1,1) ( 1 , 0 , 1 , 1 )
i gamma ^(i) Vector i gamma ^(i) Vector
0 1 (0,0,0,1) 8 gamma^(2)+1 (0,1,0,1)
1 gamma (0,0,1,0) 9 gamma^(3)+gamma (1,0,1,0)
2 gamma^(2) (0,1,0,0) 10 gamma^(2)+gamma+1 (0,1,1,1)
3 gamma^(3) (1,0,0,0) 11 gamma^(3)+gamma^(2)+gamma (1,1,1,0)
4 gamma+1 (0,0,1,1) 12 gamma^(3)+gamma^(2)+gamma+1 (1,1,1,1)
5 gamma^(2)+gamma (0,1,1,0) 13 gamma^(3)+gamma^(2)+1 (1,1,0,1)
6 gamma^(3)+gamma^(2) (1,1,0,0) 14 gamma^(3)+1 (1,0,0,1)
7 gamma^(3)+gamma+1 (1,0,1,1) | $i$ | $\gamma^i$ | Vector | $i$ | $\gamma^i$ | Vector |
| :— | :— | :— | :— | :— | :— |
| 0 | 1 | $(0,0,0,1)$ | 8 | $\gamma^2+1$ | $(0,1,0,1)$ |
| 1 | $\gamma$ | $(0,0,1,0)$ | 9 | $\gamma^3+\gamma$ | $(1,0,1,0)$ |
| 2 | $\gamma^2$ | $(0,1,0,0)$ | 10 | $\gamma^2+\gamma+1$ | $(0,1,1,1)$ |
| 3 | $\gamma^3$ | $(1,0,0,0)$ | 11 | $\gamma^3+\gamma^2+\gamma$ | $(1,1,1,0)$ |
| 4 | $\gamma+1$ | $(0,0,1,1)$ | 12 | $\gamma^3+\gamma^2+\gamma+1$ | $(1,1,1,1)$ |
| 5 | $\gamma^2+\gamma$ | $(0,1,1,0)$ | 13 | $\gamma^3+\gamma^2+1$ | $(1,1,0,1)$ |
| 6 | $\gamma^3+\gamma^2$ | $(1,1,0,0)$ | 14 | $\gamma^3+1$ | $(1,0,0,1)$ |
| 7 | $\gamma^3+\gamma+1$ | $(1,0,1,1)$ | | | |
i) Prepare logarithm and antilogarithm tables as given in page 23 of block 1.
ii) Compute
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
γ
4
+
γ
2
+
γ
3
+
γ
+
1
1
+
γ
2
+
γ
4
1
+
γ
3
((gamma^(4)+gamma^(2))+(gamma^(3)+gamma+1))/((1+gamma^(2)+gamma^(4))(1+gamma^(3))) \frac{\left(\gamma^4+\gamma^2\right)+\left(\gamma^3+\gamma+1\right)}{\left(1+\gamma^2+\gamma^4\right)\left(1+\gamma^3\right)} ( γ 4 + γ 2 ) + ( γ 3 + γ + 1 ) ( 1 + γ 2 + γ 4 ) ( 1 + γ 3 ) and
γ
2
(
γ
2
+
γ
+
1
)
(
γ
3
+
γ
2
)
(
1
+
γ
6
)
γ
2
γ
2
+
γ
+
1
γ
3
+
γ
2
1
+
γ
6
(gamma^(2)(gamma^(2)+gamma+1))/((gamma^(3)+gamma^(2))(1+gamma^(6))) \frac{\gamma^2\left(\gamma^2+\gamma+1\right)}{\left(\gamma^3+\gamma^2\right)\left(1+\gamma^6\right)} γ 2 ( γ 2 + γ + 1 ) ( γ 3 + γ 2 ) ( 1 + γ 6 ) using the logarithm and antilogarithm tables.
a) Decrypt each of the following cipher texts:
i) Text: "CBBGYAEBBFZCFEPXYAEBB", encrypted with affine cipher with key
(
7
,
2
)
(
7
,
2
)
(7,2) (7,2) ( 7 , 2 ) .
ii) Text:"KSTYZKESLNZUV", encrypted with Vigenère cipher with key "RESULT".
b) Another version of the columnar transposition cipher is the cipher using a key word. In this cipher, we encrypt as follows: Given a key word, we remove all the duplicate characters in the key word. For example, if the key word is ‘SECRET’, we remove the second ‘E’ and use ‘SECRT’ as the key word. To encrypt, we form a table as follows: In the first row, we write down the key word. In the following rows, we write the plaintext. Suppose we want to encrypt the text ‘ATTACKATDAWN’. We make a table as follows:
S
S
S \mathbf{S} S
E
E
E \mathbf{E} E
C
C
C \mathbf{C} C
R
R
R \mathbf{R} R
T
T
T \mathbf{T} T
A
T
T
A
C
K
A
T
D
A
W
N
X
X
X
S E C R T
A T T A C
K A T D A
W N X X X | $\mathbf{S}$ | $\mathbf{E}$ | $\mathbf{C}$ | $\mathbf{R}$ | $\mathbf{T}$ |
| :—: | :—: | :—: | :—: | :—: |
| A | T | T | A | C |
| K | A | T | D | A |
| W | N | X | X | X |
Then we read off the columns in alphabetical order. We first read the column under ‘ C ‘, followed by the columns under ‘
E
E
E E E ‘, ‘
R
R
R R R ‘, ‘
S
S
S S S ‘ and ‘
T
T
T T T ‘. We get the cipher text TTX TAN ADX AKW CAX. To decrypt, we reverse the process. Note that, since we know the length of the keyword, we can find the length of the columns by dividing the length of the message by the length of the keyword.
Given the ciphertext ‘HNDWUEOESSRORUTXLARFASUXTINOOGFNEGASTORX’ and the key word ‘LANCE’, find the plaintext.
a) Find the inverse of
13
(
mod
51
)
13
(
mod
51
)
13(mod 51) 13(\bmod 51) 13 ( mod 51 ) using extended euclidean algorithm.
b) Use Miller-Rabin test to check whether 75521 is a strong pseuodprime to the base 2 .
a) In this exercise, we introduce you to Hill cipher. In this cipher, we convert our message to numbers, just as in affine cipher. However, instead of encrypting character by character, we encrypt pairs of characters by multiplying them with an invertible matrix with co-efficients in
Z
26
Z
26
Z_(26) \mathbf{Z}_{26} Z 26 .
Here is an example: Suppose we want to ENCRYPT "ALLISWELL". Since we require the plaintext to have even number of characters, we pad the message with the character ‘ X ‘. We break up the message into pairs of characters AL, LI, SW, EL and LX. We convert each pair of characters into a pair elements in
Z
26
Z
26
Z_(26) \mathbf{Z}_{26} Z 26 as follows:
A
L
A
L
AL A L A L
(
0
―
,
1
―
)
(
0
¯
,
1
¯
)
( bar(0), bar(1)) (\overline{0}, \overline{1}) ( 0 ― , 1 ― )
L
I
L
I
LI L I L I
(
11
―
,
8
―
)
(
11
¯
,
8
¯
)
( bar(11), bar(8)) (\overline{11}, \overline{8}) ( 11 ― , 8 ― )
S
W
S
W
SW S W S W
(
18
―
,
22
―
)
(
18
¯
,
22
¯
)
( bar(18), bar(22)) (\overline{18}, \overline{22}) ( 18 ― , 22 ― )
E
L
E
L
EL E L E L
(
4
―
,
1
―
)
(
4
¯
,
1
¯
)
( bar(4), bar(1)) (\overline{4}, \overline{1}) ( 4 ― , 1 ― )
L
X
L
X
LX L X L X
(
11
―
,
23
―
)
(
11
¯
,
23
¯
)
( bar(11), bar(23)) (\overline{11}, \overline{23}) ( 11 ― , 23 ― )
AL ( bar(0), bar(1))
LI ( bar(11), bar(8))
SW ( bar(18), bar(22))
EL ( bar(4), bar(1))
LX ( bar(11), bar(23)) | $A L$ | $(\overline{0}, \overline{1})$ |
| :— | :— |
| $L I$ | $(\overline{11}, \overline{8})$ |
| $S W$ | $(\overline{18}, \overline{22})$ |
| $E L$ | $(\overline{4}, \overline{1})$ |
| $L X$ | $(\overline{11}, \overline{23})$ |
Next, we choose an inveritble
2
×
2
2
×
2
2xx2 2 \times 2 2 × 2 matrix with coefficients in
Z
26
Z
26
Z_(26) \mathbf{Z}_{26} Z 26 , for example,
A
=
[
3
―
1
―
7
―
1
4
]
A
=
3
¯
1
¯
7
¯
1
4
A=[[ bar(3), bar(1)],[ bar(7),(1)/(4)]] A=\left[\begin{array}{ll}\overline{3} & \overline{1} \\ \overline{7} & \frac{1}{4}\end{array}\right] A = [ 3 ― 1 ― 7 ― 1 4 ] . This matrix has determinant
3
―
⋅
4
―
−
7
―
⋅
1
―
=
5
―
3
¯
⋅
4
¯
−
7
¯
⋅
1
¯
=
5
¯
bar(3)* bar(4)- bar(7)* bar(1)= bar(5) \overline{3} \cdot \overline{4}-\overline{7} \cdot \overline{1}=\overline{5} 3 ― ⋅ 4 ― − 7 ― ⋅ 1 ― = 5 ― and
5
―
5
¯
bar(5) \overline{5} 5 ― is a unit in
Z
26
Z
26
Z_(26) Z_{26} Z 26 with inverse
21
―
21
¯
bar(21) \overline{21} 21 ― . We write each pair of elements in
Z
26
Z
26
Z_(26) Z_{26} Z 26 as a column vector and multiply it by
A
A
A A A :
We then convert each pair of numbers to a pair of characters and write them down. In this example, we get the cipher text "LSPFYGXUEN" corresponding to the plain text "ALLWELL".
To decrypt, we convert pairs of characters to pairs of numbers and multiply by
A
−
1
=
5
―
−
1
[
4
―
−
1
―
−
7
―
3
―
]
=
21
―
[
4
−
7
−
1
―
3
―
]
=
[
5
―
9
11
―
]
A
−
1
=
5
¯
−
1
4
¯
−
1
¯
−
7
¯
3
¯
=
21
¯
4
−
7
−
1
¯
3
¯
=
5
¯
9
11
¯
A^(-1)= bar(5)^(-1)[[ bar(4), bar(-1)],[ bar(-7), bar(3)]]= bar(21)[[(4)/(-7), bar(-1)],[ bar(3)]]=[[( bar(5))/(9), bar(11)]] A^{-1}=\overline{5}^{-1}\left[\begin{array}{cc}\overline{4} & \overline{-1} \\ \overline{-7} & \overline{3}\end{array}\right]=\overline{21}\left[\begin{array}{cc}\frac{4}{-7} & \overline{-1} \\ \overline{3}\end{array}\right]=\left[\begin{array}{cc}\frac{\overline{5}}{9} & \overline{11}\end{array}\right] A − 1 = 5 ― − 1 [ 4 ― − 1 ― − 7 ― 3 ― ] = 21 ― [ 4 − 7 − 1 ― 3 ― ] = [ 5 ― 9 11 ― ] and we have
Decrypt the text "TWDXHUJLUENN" which was encrypted using the Hill’s cipher with the matrix
[
3
―
1
―
0
―
9
―
]
3
¯
1
¯
0
¯
9
¯
[[ bar(3), bar(1)],[ bar(0), bar(9)]] \left[\begin{array}{cc}\overline{3} & \overline{1} \\ \overline{0} & \overline{9}\end{array}\right] [ 3 ― 1 ― 0 ― 9 ― ] as the encryption matrix.
5) a) Decrypt the ciphertext 101000111001 which was encrypted with the Toy block cipher once using the key 101010010. Show all the steps.
b) A 64 bit key for the DES is given below
11000111
10000101
11110111
11000001
11111011
10101011
10011101
10010001
11000111
10000101
11110111
11000001
11111011
10101011
10011101
10010001
{:[11000111,10000101],[11110111,11000001],[11111011,10101011],[10011101,10010001]:} \begin{array}{ll}
11000111 & 10000101 \\
11110111 & 11000001 \\
11111011 & 10101011 \\
10011101 & 10010001
\end{array} 11000111 10000101 11110111 11000001 11111011 10101011 10011101 10010001
i) Check whether the key is error free using the parity bits.
ii) Find the keys for the second round.
6) a) Considering the bytes 10001001 and 10101010 as elements of the field
F
2
[
X
]
/
⟨
g
(
X
)
⟩
F
2
[
X
]
/
⟨
g
(
X
)
⟩
F_(2)[X]//(:g(X):) \mathbf{F}_2[X] /\langle g(X)\rangle F 2 [ X ] / ⟨ g ( X ) ⟩ , where
g
(
X
)
g
(
X
)
g(X) g(X) g ( X ) is the polynomial
X
8
+
X
4
+
X
3
+
X
+
1
X
8
+
X
4
+
X
3
+
X
+
1
X^(8)+X^(4)+X^(3)+X+1 X^8+X^4+X^3+X+1 X 8 + X 4 + X 3 + X + 1 , find their product and quotient.
b) Find a recurrence that generates the sequence 110110110110110 .
7) a) Apply the frequency test, serial test and autocorrelation test to the following sequence at level of significance
α
=
0.05
α
=
0.05
alpha=0.05 \alpha=0.05 α = 0.05 :
011001110000110010011100 .
b) Apply poker test to the following sequence with level of significane
α
=
0.05
α
=
0.05
alpha=0.05 \alpha=0.05 α = 0.05 .
1001101000010000101111011
01110100101101100100110 .
c) Apply runs test to the following sequence:
1001101000010000101111011
0111010010110110010011010
0110011100001100100111000
1100001101010111101001110
0010001111000001101010010
1000110100000110100101101
1110001001
8) a) Decrypt the message
c
=
23
c
=
23
c=23 c=23 c = 23 that was encrypted using RSA algorithm with
e
=
43
e
=
43
e=43 e=43 e = 43 and
n
=
77
n
=
77
n=77 n=77 n = 77 .
b) i) Bob uses ElGamal cyrptosystem with parameters
p
=
47
,
g
=
5
p
=
47
,
g
=
5
p=47,g=5 p=47, g=5 p = 47 , g = 5 and the secret value
x
=
3
x
=
3
x=3 x=3 x = 3 . What values will he make public?
ii) Alice wants to send Bob the message
M
=
15
M
=
15
M=15 \mathscr{M}=15 M = 15 . She chooses
k
=
5
k
=
5
k=5 k=5 k = 5 . How will she compute the cipher text? What information does she send to Bob?
iii) Explain how Bob will decrypt the message.
a) Solve the discrete logarithm problem
5
x
≡
22
(
mod
47
)
5
x
≡
22
(
mod
47
)
5^(x)-=22(mod 47) 5^x \equiv 22(\bmod 47) 5 x ≡ 22 ( mod 47 ) using Baby-Step, Giant-Step algorithm.
b) Alice wants to use the ElGamal digital signature scheme with public parameters
p
=
47
,
α
=
2
p
=
47
,
α
=
2
p=47,alpha=2 p=47, \alpha=2 p = 47 , α = 2 , secret value
a
=
7
a
=
7
a=7 a=7 a = 7 and
β
=
34
β
=
34
beta=34 \beta=34 β = 34 . She wants to sign the message
M
=
20
M
=
20
M=20 \mathscr{M}=20 M = 20 and send it to Bob. She chooses
k
=
5
k
=
5
k=5 k=5 k = 5 as the secret value. Explain the procedure that Alice will use for computing the signature of the message. What information will she send Bob?
c) Alice wants to use the Digital Signature algorithm for signing messages. She chooses
p
=
83
p
=
83
p=83 p=83 p = 83 ,
q
=
41
,
g
=
2
q
=
41
,
g
=
2
q=41,g=2 q=41, g=2 q = 41 , g = 2 and
a
=
3
a
=
3
a=3 a=3 a = 3 . Alice wants to sign the message
M
=
20
M
=
20
M=20 \mathscr{M}=20 M = 20 . She chooses the secret value
k
=
8
k
=
8
k=8 k=8 k = 8 . Explain the procedure that Alice will use for computing the signature. What information will she send Bob?
Expert Answer
Question:-1(a)
Let
f
(
x
)
=
x
3
−
x
−
1
∈
Z
5
[
x
]
f
(
x
)
=
x
3
−
x
−
1
∈
Z
5
[
x
]
f(x)=x^(3)-x-1inZ_(5)[x] f(x)=x^3-x-1 \in \mathbf{Z}_5[x] f ( x ) = x 3 − x − 1 ∈ Z 5 [ x ] . Find the product of
x
2
+
2
x
+
1
+
(
f
(
x
)
)
x
2
+
2
x
+
1
+
(
f
(
x
)
)
x^(2)+2x+1+(f(x)) x^2+2 x+1+(f(x)) x 2 + 2 x + 1 + ( f ( x ) ) and
x
2
+
3
x
−
1
+
(
f
(
x
)
)
x
2
+
3
x
−
1
+
(
f
(
x
)
)
x^(2)+3x-1+(f(x)) x^2+3 x-1+(f(x)) x 2 + 3 x − 1 + ( f ( x ) ) using the algorithm in page 23, block 1. You should show all the steps as in example 11, page 22, block 1.
Answer:
Step 1: Express the polynomials
We have:
c
=
x
2
+
2
x
+
1
+
(
f
(
x
)
)
and
d
=
x
2
+
3
x
−
1
+
(
f
(
x
)
)
c
=
x
2
+
2
x
+
1
+
(
f
(
x
)
)
and
d
=
x
2
+
3
x
−
1
+
(
f
(
x
)
)
c=x^(2)+2x+1+(f(x))quad”and”quad d=x^(2)+3x-1+(f(x)) c = x^2 + 2x + 1 + (f(x)) \quad \text{and} \quad d = x^2 + 3x – 1 + (f(x)) c = x 2 + 2 x + 1 + ( f ( x ) ) and d = x 2 + 3 x − 1 + ( f ( x ) )
where
f
(
x
)
=
x
3
−
x
−
1
f
(
x
)
=
x
3
−
x
−
1
f(x)=x^(3)-x-1 f(x) = x^3 – x – 1 f ( x ) = x 3 − x − 1
In
Z
5
[
x
]
Z
5
[
x
]
Z_(5)[x] \mathbb{Z}_5[x] Z 5 [ x ] , the polynomial coefficients are represented modulo 5.
Step 2: Represent the polynomials as arrays
The polynomial
c
c
c c c can be represented by the array
A
A
A A A :
A
=
1
2
1
A
=
1
2
1
A={:[1,2,1]:} A = \begin{array}{|l|l|l|}
\hline
1 & 2 & 1 \\
\hline
\end{array} A = 1 2 1
where
A
[
0
]
=
1
A
[
0
]
=
1
A[0]=1 A[0] = 1 A [ 0 ] = 1 ,
A
[
1
]
=
2
A
[
1
]
=
2
A[1]=2 A[1] = 2 A [ 1 ] = 2 , and
A
[
2
]
=
1
A
[
2
]
=
1
A[2]=1 A[2] = 1 A [ 2 ] = 1 are the coefficients of
1
1
1 1 1 ,
x
x
x x x , and
x
2
x
2
x^(2) x^2 x 2 , respectively.
The polynomial
d
d
d d d can be represented by the array
B
B
B B B :
B
=
4
3
1
B
=
4
3
1
B={:[4,3,1]:} B = \begin{array}{|l|l|l|}
\hline
4 & 3 & 1 \\
\hline
\end{array} B = 4 3 1
where
B
[
0
]
=
4
B
[
0
]
=
4
B[0]=4 B[0] = 4 B [ 0 ] = 4 (since
−
1
≡
4
mod
5
−
1
≡
4
mod
5
-1-=4mod5 -1 \equiv 4 \mod 5 − 1 ≡ 4 mod 5 ),
B
[
1
]
=
3
B
[
1
]
=
3
B[1]=3 B[1] = 3 B [ 1 ] = 3 , and
B
[
2
]
=
1
B
[
2
]
=
1
B[2]=1 B[2] = 1 B [ 2 ] = 1 are the coefficients of
−
1
−
1
-1 -1 − 1 ,
x
x
x x x , and
x
2
x
2
x^(2) x^2 x 2 , respectively.
Step 3: Initialize the product array
We are multiplying two degree-2 polynomials, so the resulting polynomial will have degree 4. We initialize the product array
P
P
P P P of size 5 with all entries as 0:
P
=
0
0
0
0
0
P
=
0
0
0
0
0
P={:[0,0,0,0,0]:} P = \begin{array}{|l|l|l|l|l|}
\hline
0 & 0 & 0 & 0 & 0 \\
\hline
\end{array} P = 0 0 0 0 0
Step 4: Multiply the polynomials
We perform the polynomial multiplication by computing the coefficients of each power of
x
x
x x x in the resulting polynomial.
Term 1: Multiply
B
[
0
]
×
A
B
[
0
]
×
A
B[0]xx A B[0] \times A B [ 0 ] × A
First, we multiply the constant term
B
[
0
]
=
4
B
[
0
]
=
4
B[0]=4 B[0] = 4 B [ 0 ] = 4 by the entire polynomial
A
A
A A A . This gives:
B
[
0
]
×
A
=
4
×
(
x
2
+
2
x
+
1
)
=
4
x
2
+
8
x
+
4
=
4
x
2
+
3
x
+
4
(
mod
5
)
B
[
0
]
×
A
=
4
×
(
x
2
+
2
x
+
1
)
=
4
x
2
+
8
x
+
4
=
4
x
2
+
3
x
+
4
(
mod
5
)
B[0]xx A=4xx(x^(2)+2x+1)=4x^(2)+8x+4=4x^(2)+3x+4quad(“mod “5) B[0] \times A = 4 \times (x^2 + 2x + 1) = 4x^2 + 8x + 4 = 4x^2 + 3x + 4 \quad (\text{mod } 5) B [ 0 ] × A = 4 × ( x 2 + 2 x + 1 ) = 4 x 2 + 8 x + 4 = 4 x 2 + 3 x + 4 ( mod 5 )
This corresponds to the array:
4
3
4
0
0
4
3
4
0
0
{:[4,3,4,0,0]:} \begin{array}{|l|l|l|l|l|}
\hline
4 & 3 & 4 & 0 & 0 \\
\hline
\end{array} 4 3 4 0 0
P
=
4
3
4
0
0
P
=
4
3
4
0
0
P={:[4,3,4,0,0]:} P = \begin{array}{|l|l|l|l|l|}
\hline
4 & 3 & 4 & 0 & 0 \\
\hline
\end{array} P = 4 3 4 0 0
Term 2: Multiply
B
[
1
]
×
x
A
B
[
1
]
×
x
A
B[1]xx xA B[1] \times xA B [ 1 ] × x A
Next, we multiply the
x
x
x x x -term
B
[
1
]
=
3
B
[
1
]
=
3
B[1]=3 B[1] = 3 B [ 1 ] = 3 by
A
A
A A A , shifted by 1 position:
B
[
1
]
×
A
=
3
×
(
x
2
+
2
x
+
1
)
=
3
x
2
+
6
x
+
3
=
3
x
2
+
x
+
3
(
mod
5
)
B
[
1
]
×
A
=
3
×
(
x
2
+
2
x
+
1
)
=
3
x
2
+
6
x
+
3
=
3
x
2
+
x
+
3
(
mod
5
)
B[1]xx A=3xx(x^(2)+2x+1)=3x^(2)+6x+3=3x^(2)+x+3quad(“mod “5) B[1] \times A = 3 \times (x^2 + 2x + 1) = 3x^2 + 6x + 3 = 3x^2 + x + 3 \quad (\text{mod } 5) B [ 1 ] × A = 3 × ( x 2 + 2 x + 1 ) = 3 x 2 + 6 x + 3 = 3 x 2 + x + 3 ( mod 5 )
Shift this result by 1 position:
0
3
1
3
0
0
3
1
3
0
{:[0,3,1,3,0]:} \begin{array}{|l|l|l|l|l|}
\hline
0 & 3 & 1 & 3 & 0 \\
\hline
\end{array} 0 3 1 3 0
P
=
4
1
0
3
0
P
=
4
1
0
3
0
P={:[4,1,0,3,0]:} P = \begin{array}{|l|l|l|l|l|}
\hline
4 & 1 & 0 & 3 & 0 \\
\hline
\end{array} P = 4 1 0 3 0
Term 3: Multiply
B
[
2
]
×
x
2
A
B
[
2
]
×
x
2
A
B[2]xxx^(2)A B[2] \times x^2 A B [ 2 ] × x 2 A
Finally, we multiply the
x
2
x
2
x^(2) x^2 x 2 -term
B
[
2
]
=
1
B
[
2
]
=
1
B[2]=1 B[2] = 1 B [ 2 ] = 1 by
A
A
A A A , shifted by 2 positions:
B
[
2
]
×
A
=
1
×
(
x
2
+
2
x
+
1
)
=
x
2
+
2
x
+
1
B
[
2
]
×
A
=
1
×
(
x
2
+
2
x
+
1
)
=
x
2
+
2
x
+
1
B[2]xx A=1xx(x^(2)+2x+1)=x^(2)+2x+1 B[2] \times A = 1 \times (x^2 + 2x + 1) = x^2 + 2x + 1 B [ 2 ] × A = 1 × ( x 2 + 2 x + 1 ) = x 2 + 2 x + 1
Shift this result by 2 positions:
0
0
1
2
1
0
0
1
2
1
{:[0,0,1,2,1]:} \begin{array}{|l|l|l|l|l|}
\hline
0 & 0 & 1 & 2 & 1 \\
\hline
\end{array} 0 0 1 2 1
P
=
4
1
1
0
1
P
=
4
1
1
0
1
P={:[4,1,1,0,1]:} P = \begin{array}{|l|l|l|l|l|}
\hline
4 & 1 & 1 & 0 & 1 \\
\hline
\end{array} P = 4 1 1 0 1
Step 5: Final result
The resulting array
P
P
P P P corresponds to the polynomial:
P
(
x
)
=
x
4
+
x
2
+
x
+
4
P
(
x
)
=
x
4
+
x
2
+
x
+
4
P(x)=x^(4)+x^(2)+x+4 P(x) = x^4 + x^2 + x + 4 P ( x ) = x 4 + x 2 + x + 4
Thus, the product of
c
c
c c c and
d
d
d d d in
Z
5
[
x
]
Z
5
[
x
]
Z_(5)[x] \mathbb{Z}_5[x] Z 5 [ x ] is:
x
4
+
x
2
+
x
+
4
x
4
+
x
2
+
x
+
4
x^(4)+x^(2)+x+4 x^4 + x^2 + x + 4 x 4 + x 2 + x + 4
Question:-1(b)
Let
f
(
x
)
=
x
4
+
x
+
1
∈
F
2
[
x
]
f
(
x
)
=
x
4
+
x
+
1
∈
F
2
[
x
]
f(x)=x^(4)+x+1inF_(2)[x] f(x)=x^4+x+1 \in \mathbf{F}_2[x] f ( x ) = x 4 + x + 1 ∈ F 2 [ x ] . We represent the field
F
2
4
F
2
4
F_(2^(4)) \mathbf{F}_{2^4} F 2 4 by
F
2
[
x
]
/
(
f
(
x
)
)
F
2
[
x
]
/
(
f
(
x
)
)
F_(2)[x]//(f(x)) \mathbf{F}_2[x] /(f(x)) F 2 [ x ] / ( f ( x ) ) . Let us write
γ
=
x
+
(
f
(
x
)
)
γ
=
x
+
(
f
(
x
)
)
gamma=x+(f(x)) \gamma=x+(f(x)) γ = x + ( f ( x ) ) . The table of values is given below:
i
γ
i
V
e
c
t
o
r
i
γ
i
V
e
c
t
o
r
0
1
(
0
,
0
,
0
,
1
)
8
γ
2
+
1
(
0
,
1
,
0
,
1
)
1
γ
(
0
,
0
,
1
,
0
)
9
γ
3
+
γ
(
1
,
0
,
1
,
0
)
2
γ
2
(
0
,
1
,
0
,
0
)
10
γ
2
+
γ
+
1
(
0
,
1
,
1
,
1
)
3
γ
3
(
1
,
0
,
0
,
0
)
11
γ
3
+
γ
2
+
γ
(
1
,
1
,
1
,
0
)
4
γ
+
1
(
0
,
0
,
1
,
1
)
12
γ
3
+
γ
2
+
γ
+
1
(
1
,
1
,
1
,
1
)
5
γ
2
+
γ
(
0
,
1
,
1
,
0
)
13
γ
3
+
γ
2
+
1
(
1
,
1
,
0
,
1
)
6
γ
3
+
γ
2
(
1
,
1
,
0
,
0
)
14
γ
3
+
1
(
1
,
0
,
0
,
1
)
7
γ
3
+
γ
+
1
(
1
,
0
,
1
,
1
)
i
γ
i
V
e
c
t
o
r
i
γ
i
V
e
c
t
o
r
0
1
(
0
,
0
,
0
,
1
)
8
γ
2
+
1
(
0
,
1
,
0
,
1
)
1
γ
(
0
,
0
,
1
,
0
)
9
γ
3
+
γ
(
1
,
0
,
1
,
0
)
2
γ
2
(
0
,
1
,
0
,
0
)
10
γ
2
+
γ
+
1
(
0
,
1
,
1
,
1
)
3
γ
3
(
1
,
0
,
0
,
0
)
11
γ
3
+
γ
2
+
γ
(
1
,
1
,
1
,
0
)
4
γ
+
1
(
0
,
0
,
1
,
1
)
12
γ
3
+
γ
2
+
γ
+
1
(
1
,
1
,
1
,
1
)
5
γ
2
+
γ
(
0
,
1
,
1
,
0
)
13
γ
3
+
γ
2
+
1
(
1
,
1
,
0
,
1
)
6
γ
3
+
γ
2
(
1
,
1
,
0
,
0
)
14
γ
3
+
1
(
1
,
0
,
0
,
1
)
7
γ
3
+
γ
+
1
(
1
,
0
,
1
,
1
)
{:[i,gamma ^(i),Vector,i,gamma ^(i),Vector],[0,1,(0″,”0″,”0″,”1),8,gamma^(2)+1,(0″,”1″,”0″,”1)],[1,gamma,(0″,”0″,”1″,”0),9,gamma^(3)+gamma,(1″,”0″,”1″,”0)],[2,gamma^(2),(0″,”1″,”0″,”0),10,gamma^(2)+gamma+1,(0″,”1″,”1″,”1)],[3,gamma^(3),(1″,”0″,”0″,”0),11,gamma^(3)+gamma^(2)+gamma,(1″,”1″,”1″,”0)],[4,gamma+1,(0″,”0″,”1″,”1),12,gamma^(3)+gamma^(2)+gamma+1,(1″,”1″,”1″,”1)],[5,gamma^(2)+gamma,(0″,”1″,”1″,”0),13,gamma^(3)+gamma^(2)+1,(1″,”1″,”0″,”1)],[6,gamma^(3)+gamma^(2),(1″,”1″,”0″,”0),14,gamma^(3)+1,(1″,”0″,”0″,”1)],[7,gamma^(3)+gamma+1,(1″,”0″,”1″,”1),,,]:} \begin{array}{|l|l|l|l|l|l|}
\hline i & \gamma^i & Vector & i & \gamma^i & Vector \\
\hline 0 & 1 & (0,0,0,1) & 8 & \gamma^2+1 & (0,1,0,1) \\
1 & \gamma & (0,0,1,0) & 9 & \gamma^3+\gamma & (1,0,1,0) \\
2 & \gamma^2 & (0,1,0,0) & 10 & \gamma^2+\gamma+1 & (0,1,1,1) \\
3 & \gamma^3 & (1,0,0,0) & 11 & \gamma^3+\gamma^2+\gamma & (1,1,1,0) \\
4 & \gamma+1 & (0,0,1,1) & 12 & \gamma^3+\gamma^2+\gamma+1 & (1,1,1,1) \\
5 & \gamma^2+\gamma & (0,1,1,0) & 13 & \gamma^3+\gamma^2+1 & (1,1,0,1) \\
6 & \gamma^3+\gamma^2 & (1,1,0,0) & 14 & \gamma^3+1 & (1,0,0,1) \\
7 & \gamma^3+\gamma+1 & (1,0,1,1) & & & \\
\hline
\end{array} i γ i V e c t o r i γ i V e c t o r 0 1 ( 0 , 0 , 0 , 1 ) 8 γ 2 + 1 ( 0 , 1 , 0 , 1 ) 1 γ ( 0 , 0 , 1 , 0 ) 9 γ 3 + γ ( 1 , 0 , 1 , 0 ) 2 γ 2 ( 0 , 1 , 0 , 0 ) 10 γ 2 + γ + 1 ( 0 , 1 , 1 , 1 ) 3 γ 3 ( 1 , 0 , 0 , 0 ) 11 γ 3 + γ 2 + γ ( 1 , 1 , 1 , 0 ) 4 γ + 1 ( 0 , 0 , 1 , 1 ) 12 γ 3 + γ 2 + γ + 1 ( 1 , 1 , 1 , 1 ) 5 γ 2 + γ ( 0 , 1 , 1 , 0 ) 13 γ 3 + γ 2 + 1 ( 1 , 1 , 0 , 1 ) 6 γ 3 + γ 2 ( 1 , 1 , 0 , 0 ) 14 γ 3 + 1 ( 1 , 0 , 0 , 1 ) 7 γ 3 + γ + 1 ( 1 , 0 , 1 , 1 )
i) Prepare logarithm and antilogarithm tables as given in page 23 of block 1.
ii) Compute
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
γ
4
+
γ
2
+
γ
3
+
γ
+
1
1
+
γ
2
+
γ
4
1
+
γ
3
((gamma^(4)+gamma^(2))+(gamma^(3)+gamma+1))/((1+gamma^(2)+gamma^(4))(1+gamma^(3))) \frac{\left(\gamma^4+\gamma^2\right)+\left(\gamma^3+\gamma+1\right)}{\left(1+\gamma^2+\gamma^4\right)\left(1+\gamma^3\right)} ( γ 4 + γ 2 ) + ( γ 3 + γ + 1 ) ( 1 + γ 2 + γ 4 ) ( 1 + γ 3 ) and
γ
2
(
γ
2
+
γ
+
1
)
(
γ
3
+
γ
2
)
(
1
+
γ
6
)
γ
2
γ
2
+
γ
+
1
γ
3
+
γ
2
1
+
γ
6
(gamma^(2)(gamma^(2)+gamma+1))/((gamma^(3)+gamma^(2))(1+gamma^(6))) \frac{\gamma^2\left(\gamma^2+\gamma+1\right)}{\left(\gamma^3+\gamma^2\right)\left(1+\gamma^6\right)} γ 2 ( γ 2 + γ + 1 ) ( γ 3 + γ 2 ) ( 1 + γ 6 ) using the logarithm and antilogarithm tables.
Answer:
Part (i): Logarithm and Antilogarithm Tables
Given the values of powers of
γ
γ
gamma \gamma γ and their corresponding vectors in
F
2
4
F
2
4
F_(2^(4)) \mathbb{F}_{2^4} F 2 4 , we can construct the logarithm and antilogarithm tables. Let’s first summarize the table provided in terms of powers of
γ
γ
gamma \gamma γ and then create the logarithm and antilogarithm tables.
Powers of
γ
γ
gamma \gamma γ :
γ
0
=
1
(Vector:
(
0
,
0
,
0
,
1
)
)
γ
1
=
γ
(Vector:
(
0
,
0
,
1
,
0
)
)
γ
2
=
γ
2
(Vector:
(
0
,
1
,
0
,
0
)
)
γ
3
=
γ
3
(Vector:
(
1
,
0
,
0
,
0
)
)
γ
4
=
γ
+
1
(Vector:
(
0
,
0
,
1
,
1
)
)
γ
5
=
γ
2
+
γ
(Vector:
(
0
,
1
,
1
,
0
)
)
γ
6
=
γ
3
+
γ
2
(Vector:
(
1
,
1
,
0
,
0
)
)
γ
7
=
γ
3
+
γ
+
1
(Vector:
(
1
,
0
,
1
,
1
)
)
γ
8
=
γ
2
+
1
(Vector:
(
0
,
1
,
0
,
1
)
)
γ
9
=
γ
3
+
γ
(Vector:
(
1
,
0
,
1
,
0
)
)
γ
10
=
γ
2
+
γ
+
1
(Vector:
(
0
,
1
,
1
,
1
)
)
γ
11
=
γ
3
+
γ
2
+
γ
(Vector:
(
1
,
1
,
1
,
0
)
)
γ
12
=
γ
3
+
γ
2
+
γ
+
1
(Vector:
(
1
,
1
,
1
,
1
)
)
γ
13
=
γ
3
+
γ
2
+
1
(Vector:
(
1
,
1
,
0
,
1
)
)
γ
14
=
γ
3
+
1
(Vector:
(
1
,
0
,
0
,
1
)
)
γ
0
=
1
(Vector:
(
0
,
0
,
0
,
1
)
)
γ
1
=
γ
(Vector:
(
0
,
0
,
1
,
0
)
)
γ
2
=
γ
2
(Vector:
(
0
,
1
,
0
,
0
)
)
γ
3
=
γ
3
(Vector:
(
1
,
0
,
0
,
0
)
)
γ
4
=
γ
+
1
(Vector:
(
0
,
0
,
1
,
1
)
)
γ
5
=
γ
2
+
γ
(Vector:
(
0
,
1
,
1
,
0
)
)
γ
6
=
γ
3
+
γ
2
(Vector:
(
1
,
1
,
0
,
0
)
)
γ
7
=
γ
3
+
γ
+
1
(Vector:
(
1
,
0
,
1
,
1
)
)
γ
8
=
γ
2
+
1
(Vector:
(
0
,
1
,
0
,
1
)
)
γ
9
=
γ
3
+
γ
(Vector:
(
1
,
0
,
1
,
0
)
)
γ
10
=
γ
2
+
γ
+
1
(Vector:
(
0
,
1
,
1
,
1
)
)
γ
11
=
γ
3
+
γ
2
+
γ
(Vector:
(
1
,
1
,
1
,
0
)
)
γ
12
=
γ
3
+
γ
2
+
γ
+
1
(Vector:
(
1
,
1
,
1
,
1
)
)
γ
13
=
γ
3
+
γ
2
+
1
(Vector:
(
1
,
1
,
0
,
1
)
)
γ
14
=
γ
3
+
1
(Vector:
(
1
,
0
,
0
,
1
)
)
{:[gamma^(0)=1(Vector: (0″,”0″,”0″,”1)”)”],[gamma^(1)=gamma(Vector: (0″,”0″,”1″,”0)”)”],[gamma^(2)=gamma^(2)(Vector: (0″,”1″,”0″,”0)”)”],[gamma^(3)=gamma^(3)(Vector: (1″,”0″,”0″,”0)”)”],[gamma^(4)=gamma+1(Vector: (0″,”0″,”1″,”1)”)”],[gamma^(5)=gamma^(2)+gamma(Vector: (0″,”1″,”1″,”0)”)”],[gamma^(6)=gamma^(3)+gamma^(2)(Vector: (1″,”1″,”0″,”0)”)”],[gamma^(7)=gamma^(3)+gamma+1(Vector: (1″,”0″,”1″,”1)”)”],[gamma^(8)=gamma^(2)+1(Vector: (0″,”1″,”0″,”1)”)”],[gamma^(9)=gamma^(3)+gamma(Vector: (1″,”0″,”1″,”0)”)”],[gamma^(10)=gamma^(2)+gamma+1(Vector: (0″,”1″,”1″,”1)”)”],[gamma^(11)=gamma^(3)+gamma^(2)+gamma(Vector: (1″,”1″,”1″,”0)”)”],[gamma^(12)=gamma^(3)+gamma^(2)+gamma+1(Vector: (1″,”1″,”1″,”1)”)”],[gamma^(13)=gamma^(3)+gamma^(2)+1(Vector: (1″,”1″,”0″,”1)”)”],[gamma^(14)=gamma^(3)+1(Vector: (1″,”0″,”0″,”1)”)”]:} \begin{aligned}
\gamma^0 &= 1 & \text{(Vector: } (0, 0, 0, 1)\text{)} \\
\gamma^1 &= \gamma & \text{(Vector: } (0, 0, 1, 0)\text{)} \\
\gamma^2 &= \gamma^2 & \text{(Vector: } (0, 1, 0, 0)\text{)} \\
\gamma^3 &= \gamma^3 & \text{(Vector: } (1, 0, 0, 0)\text{)} \\
\gamma^4 &= \gamma + 1 & \text{(Vector: } (0, 0, 1, 1)\text{)} \\
\gamma^5 &= \gamma^2 + \gamma & \text{(Vector: } (0, 1, 1, 0)\text{)} \\
\gamma^6 &= \gamma^3 + \gamma^2 & \text{(Vector: } (1, 1, 0, 0)\text{)} \\
\gamma^7 &= \gamma^3 + \gamma + 1 & \text{(Vector: } (1, 0, 1, 1)\text{)} \\
\gamma^8 &= \gamma^2 + 1 & \text{(Vector: } (0, 1, 0, 1)\text{)} \\
\gamma^9 &= \gamma^3 + \gamma & \text{(Vector: } (1, 0, 1, 0)\text{)} \\
\gamma^{10} &= \gamma^2 + \gamma + 1 & \text{(Vector: } (0, 1, 1, 1)\text{)} \\
\gamma^{11} &= \gamma^3 + \gamma^2 + \gamma & \text{(Vector: } (1, 1, 1, 0)\text{)} \\
\gamma^{12} &= \gamma^3 + \gamma^2 + \gamma + 1 & \text{(Vector: } (1, 1, 1, 1)\text{)} \\
\gamma^{13} &= \gamma^3 + \gamma^2 + 1 & \text{(Vector: } (1, 1, 0, 1)\text{)} \\
\gamma^{14} &= \gamma^3 + 1 & \text{(Vector: } (1, 0, 0, 1)\text{)} \\
\end{aligned} γ 0 = 1 (Vector: ( 0 , 0 , 0 , 1 ) ) γ 1 = γ (Vector: ( 0 , 0 , 1 , 0 ) ) γ 2 = γ 2 (Vector: ( 0 , 1 , 0 , 0 ) ) γ 3 = γ 3 (Vector: ( 1 , 0 , 0 , 0 ) ) γ 4 = γ + 1 (Vector: ( 0 , 0 , 1 , 1 ) ) γ 5 = γ 2 + γ (Vector: ( 0 , 1 , 1 , 0 ) ) γ 6 = γ 3 + γ 2 (Vector: ( 1 , 1 , 0 , 0 ) ) γ 7 = γ 3 + γ + 1 (Vector: ( 1 , 0 , 1 , 1 ) ) γ 8 = γ 2 + 1 (Vector: ( 0 , 1 , 0 , 1 ) ) γ 9 = γ 3 + γ (Vector: ( 1 , 0 , 1 , 0 ) ) γ 10 = γ 2 + γ + 1 (Vector: ( 0 , 1 , 1 , 1 ) ) γ 11 = γ 3 + γ 2 + γ (Vector: ( 1 , 1 , 1 , 0 ) ) γ 12 = γ 3 + γ 2 + γ + 1 (Vector: ( 1 , 1 , 1 , 1 ) ) γ 13 = γ 3 + γ 2 + 1 (Vector: ( 1 , 1 , 0 , 1 ) ) γ 14 = γ 3 + 1 (Vector: ( 1 , 0 , 0 , 1 ) )
Logarithm Table
In the logarithm table, each element of the field is written in terms of a power of
γ
γ
gamma \gamma γ . The logarithm of an element is the exponent
i
i
i i i such that
γ
i
γ
i
gamma ^(i) \gamma^i γ i equals that element.
Element
Logarithm (to base
γ
)
1
0
γ
1
γ
2
2
γ
3
3
γ
+
1
4
γ
2
+
γ
5
γ
3
+
γ
2
6
γ
3
+
γ
+
1
7
γ
2
+
1
8
γ
3
+
γ
9
γ
2
+
γ
+
1
10
γ
3
+
γ
2
+
γ
11
γ
3
+
γ
2
+
γ
+
1
12
γ
3
+
γ
2
+
1
13
γ
3
+
1
14
Element
Logarithm (to base
γ
)
1
0
γ
1
γ
2
2
γ
3
3
γ
+
1
4
γ
2
+
γ
5
γ
3
+
γ
2
6
γ
3
+
γ
+
1
7
γ
2
+
1
8
γ
3
+
γ
9
γ
2
+
γ
+
1
10
γ
3
+
γ
2
+
γ
11
γ
3
+
γ
2
+
γ
+
1
12
γ
3
+
γ
2
+
1
13
γ
3
+
1
14
{:[“Element”,”Logarithm (to base “gamma”)”],[1,0],[gamma,1],[gamma^(2),2],[gamma^(3),3],[gamma+1,4],[gamma^(2)+gamma,5],[gamma^(3)+gamma^(2),6],[gamma^(3)+gamma+1,7],[gamma^(2)+1,8],[gamma^(3)+gamma,9],[gamma^(2)+gamma+1,10],[gamma^(3)+gamma^(2)+gamma,11],[gamma^(3)+gamma^(2)+gamma+1,12],[gamma^(3)+gamma^(2)+1,13],[gamma^(3)+1,14]:} \begin{array}{|c|c|}
\hline
\text{Element} & \text{Logarithm (to base } \gamma \text{)} \\
\hline
1 & 0 \\
\gamma & 1 \\
\gamma^2 & 2 \\
\gamma^3 & 3 \\
\gamma + 1 & 4 \\
\gamma^2 + \gamma & 5 \\
\gamma^3 + \gamma^2 & 6 \\
\gamma^3 + \gamma + 1 & 7 \\
\gamma^2 + 1 & 8 \\
\gamma^3 + \gamma & 9 \\
\gamma^2 + \gamma + 1 & 10 \\
\gamma^3 + \gamma^2 + \gamma & 11 \\
\gamma^3 + \gamma^2 + \gamma + 1 & 12 \\
\gamma^3 + \gamma^2 + 1 & 13 \\
\gamma^3 + 1 & 14 \\
\hline
\end{array} Element Logarithm (to base γ ) 1 0 γ 1 γ 2 2 γ 3 3 γ + 1 4 γ 2 + γ 5 γ 3 + γ 2 6 γ 3 + γ + 1 7 γ 2 + 1 8 γ 3 + γ 9 γ 2 + γ + 1 10 γ 3 + γ 2 + γ 11 γ 3 + γ 2 + γ + 1 12 γ 3 + γ 2 + 1 13 γ 3 + 1 14
Antilogarithm Table
In the antilogarithm table, for each logarithm
i
i
i i i , we provide the corresponding element
γ
i
γ
i
gamma ^(i) \gamma^i γ i .
Logarithm (to base
γ
)
Element
0
1
1
γ
2
γ
2
3
γ
3
4
γ
+
1
5
γ
2
+
γ
6
γ
3
+
γ
2
7
γ
3
+
γ
+
1
8
γ
2
+
1
9
γ
3
+
γ
10
γ
2
+
γ
+
1
11
γ
3
+
γ
2
+
γ
12
γ
3
+
γ
2
+
γ
+
1
13
γ
3
+
γ
2
+
1
14
γ
3
+
1
Logarithm (to base
γ
)
Element
0
1
1
γ
2
γ
2
3
γ
3
4
γ
+
1
5
γ
2
+
γ
6
γ
3
+
γ
2
7
γ
3
+
γ
+
1
8
γ
2
+
1
9
γ
3
+
γ
10
γ
2
+
γ
+
1
11
γ
3
+
γ
2
+
γ
12
γ
3
+
γ
2
+
γ
+
1
13
γ
3
+
γ
2
+
1
14
γ
3
+
1
{:[“Logarithm (to base “gamma”)”,”Element”],[0,1],[1,gamma],[2,gamma^(2)],[3,gamma^(3)],[4,gamma+1],[5,gamma^(2)+gamma],[6,gamma^(3)+gamma^(2)],[7,gamma^(3)+gamma+1],[8,gamma^(2)+1],[9,gamma^(3)+gamma],[10,gamma^(2)+gamma+1],[11,gamma^(3)+gamma^(2)+gamma],[12,gamma^(3)+gamma^(2)+gamma+1],[13,gamma^(3)+gamma^(2)+1],[14,gamma^(3)+1]:} \begin{array}{|c|c|}
\hline
\text{Logarithm (to base } \gamma \text{)} & \text{Element} \\
\hline
0 & 1 \\
1 & \gamma \\
2 & \gamma^2 \\
3 & \gamma^3 \\
4 & \gamma + 1 \\
5 & \gamma^2 + \gamma \\
6 & \gamma^3 + \gamma^2 \\
7 & \gamma^3 + \gamma + 1 \\
8 & \gamma^2 + 1 \\
9 & \gamma^3 + \gamma \\
10 & \gamma^2 + \gamma + 1 \\
11 & \gamma^3 + \gamma^2 + \gamma \\
12 & \gamma^3 + \gamma^2 + \gamma + 1 \\
13 & \gamma^3 + \gamma^2 + 1 \\
14 & \gamma^3 + 1 \\
\hline
\end{array} Logarithm (to base γ ) Element 0 1 1 γ 2 γ 2 3 γ 3 4 γ + 1 5 γ 2 + γ 6 γ 3 + γ 2 7 γ 3 + γ + 1 8 γ 2 + 1 9 γ 3 + γ 10 γ 2 + γ + 1 11 γ 3 + γ 2 + γ 12 γ 3 + γ 2 + γ + 1 13 γ 3 + γ 2 + 1 14 γ 3 + 1
Part (ii): Computations using the logarithm and antilogarithm tables
Expression 1:
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
((gamma^(4)+gamma^(2))+(gamma^(3)+gamma+1))/((1+gamma^(2)+gamma^(4))(1+gamma^(3))) \frac{(\gamma^4 + \gamma^2) + (\gamma^3 + \gamma + 1)}{(1 + \gamma^2 + \gamma^4)(1 + \gamma^3)} ( γ 4 + γ 2 ) + ( γ 3 + γ + 1 ) ( 1 + γ 2 + γ 4 ) ( 1 + γ 3 )
Step 1: Compute the numerator
The numerator is
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(
γ
4
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
(gamma^(4)+gamma^(2))+(gamma^(3)+gamma+1) (\gamma^4 + \gamma^2) + (\gamma^3 + \gamma + 1) ( γ 4 + γ 2 ) + ( γ 3 + γ + 1 ) . Using the logarithm table:
γ
4
+
γ
2
=
γ
+
1
+
γ
2
γ
4
+
γ
2
=
γ
+
1
+
γ
2
gamma^(4)+gamma^(2)=gamma+1+gamma^(2) \gamma^4 + \gamma^2 = \gamma + 1 + \gamma^2 γ 4 + γ 2 = γ + 1 + γ 2
γ
3
+
γ
+
1
=
γ
3
+
γ
+
1
γ
3
+
γ
+
1
=
γ
3
+
γ
+
1
gamma^(3)+gamma+1=gamma^(3)+gamma+1 \gamma^3 + \gamma + 1 = \gamma^3 + \gamma + 1 γ 3 + γ + 1 = γ 3 + γ + 1
Adding them together (in
F
2
F
2
F_(2) \mathbb{F}_2 F 2 , so addition is XOR):
(
γ
+
1
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
=
γ
3
+
γ
2
(
γ
+
1
+
γ
2
)
+
(
γ
3
+
γ
+
1
)
=
γ
3
+
γ
2
(gamma+1+gamma^(2))+(gamma^(3)+gamma+1)=gamma^(3)+gamma^(2) (\gamma + 1 + \gamma^2) + (\gamma^3 + \gamma + 1) = \gamma^3 + \gamma^2 ( γ + 1 + γ 2 ) + ( γ 3 + γ + 1 ) = γ 3 + γ 2
Thus, the numerator is
γ
3
+
γ
2
γ
3
+
γ
2
gamma^(3)+gamma^(2) \gamma^3 + \gamma^2 γ 3 + γ 2 .
Step 2: Compute the denominator
The denominator is
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
(
1
+
γ
2
+
γ
4
)
(
1
+
γ
3
)
(1+gamma^(2)+gamma^(4))(1+gamma^(3)) (1 + \gamma^2 + \gamma^4)(1 + \gamma^3) ( 1 + γ 2 + γ 4 ) ( 1 + γ 3 ) . First, simplify
1
+
γ
2
+
γ
4
1
+
γ
2
+
γ
4
1+gamma^(2)+gamma^(4) 1 + \gamma^2 + \gamma^4 1 + γ 2 + γ 4 using the logarithm table:
1
+
γ
2
+
γ
4
=
1
+
γ
2
+
(
γ
+
1
)
=
γ
+
γ
2
1
+
γ
2
+
γ
4
=
1
+
γ
2
+
(
γ
+
1
)
=
γ
+
γ
2
1+gamma^(2)+gamma^(4)=1+gamma^(2)+(gamma+1)=gamma+gamma^(2) 1 + \gamma^2 + \gamma^4 = 1 + \gamma^2 + (\gamma + 1) = \gamma + \gamma^2 1 + γ 2 + γ 4 = 1 + γ 2 + ( γ + 1 ) = γ + γ 2
Now multiply this by
1
+
γ
3
1
+
γ
3
1+gamma^(3) 1 + \gamma^3 1 + γ 3 :
(
γ
+
γ
2
)
(
1
+
γ
3
)
=
γ
+
γ
3
+
γ
2
+
γ
5
(
γ
+
γ
2
)
(
1
+
γ
3
)
=
γ
+
γ
3
+
γ
2
+
γ
5
(gamma+gamma^(2))(1+gamma^(3))=gamma+gamma^(3)+gamma^(2)+gamma^(5) (\gamma + \gamma^2)(1 + \gamma^3) = \gamma + \gamma^3 + \gamma^2 + \gamma^5 ( γ + γ 2 ) ( 1 + γ 3 ) = γ + γ 3 + γ 2 + γ 5
Since
γ
5
=
γ
2
+
γ
γ
5
=
γ
2
+
γ
gamma^(5)=gamma^(2)+gamma \gamma^5 = \gamma^2 + \gamma γ 5 = γ 2 + γ (from the logarithm table), this simplifies to:
γ
+
γ
3
+
γ
2
+
(
γ
2
+
γ
)
=
γ
3
γ
+
γ
3
+
γ
2
+
(
γ
2
+
γ
)
=
γ
3
gamma+gamma^(3)+gamma^(2)+(gamma^(2)+gamma)=gamma^(3) \gamma + \gamma^3 + \gamma^2 + (\gamma^2 + \gamma) = \gamma^3 γ + γ 3 + γ 2 + ( γ 2 + γ ) = γ 3
Thus, the denominator is
γ
3
γ
3
gamma^(3) \gamma^3 γ 3 .
Step 3: Simplify the expression
The expression becomes:
γ
3
+
γ
2
γ
3
=
1
+
γ
2
γ
3
+
γ
2
γ
3
=
1
+
γ
2
(gamma^(3)+gamma^(2))/(gamma^(3))=1+gamma^(2) \frac{\gamma^3 + \gamma^2}{\gamma^3} = 1 + \gamma^2 γ 3 + γ 2 γ 3 = 1 + γ 2
Thus, the result is
1
+
γ
2
1
+
γ
2
1+gamma^(2) 1 + \gamma^2 1 + γ 2 , which corresponds to the vector
(
0
,
1
,
0
,
1
)
(
0
,
1
,
0
,
1
)
(0,1,0,1) (0, 1, 0, 1) ( 0 , 1 , 0 , 1 ) .
Expression 2:
γ
2
(
γ
2
+
γ
+
1
)
(
γ
3
+
γ
2
)
(
1
+
γ
6
)
γ
2
(
γ
2
+
γ
+
1
)
(
γ
3
+
γ
2
)
(
1
+
γ
6
)
(gamma^(2)(gamma^(2)+gamma+1))/((gamma^(3)+gamma^(2))(1+gamma^(6))) \frac{\gamma^2(\gamma^2 + \gamma + 1)}{(\gamma^3 + \gamma^2)(1 + \gamma^6)} γ 2 ( γ 2 + γ + 1 ) ( γ 3 + γ 2 ) ( 1 + γ 6 )
Step 1: Compute the numerator
The numerator is
γ
2
(
γ
2
+
γ
+
1
)
γ
2
(
γ
2
+
γ
+
1
)
gamma^(2)(gamma^(2)+gamma+1) \gamma^2(\gamma^2 + \gamma + 1) γ 2 ( γ 2 + γ + 1 ) . Using the logarithm table:
γ
2
+
γ
+
1
=
(Vector corresponding to
(
0
,
1
,
1
,
1
)
)
γ
2
+
γ
+
1
=
(Vector corresponding to
(
0
,
1
,
1
,
1
)
)
gamma^(2)+gamma+1=(Vector corresponding to (0,1,1,1)”)” \gamma^2 + \gamma + 1 = \text{(Vector corresponding to } (0, 1, 1, 1)\text{)} γ 2 + γ + 1 = (Vector corresponding to ( 0 , 1 , 1 , 1 ) )
Multiplying by
γ
2
γ
2
gamma^(2) \gamma^2 γ 2 :
γ
2
(
γ
2
+
γ
+
1
)
=
γ
4
+
γ
3
+
γ
2
γ
2
(
γ
2
+
γ
+
1
)
=
γ
4
+
γ
3
+
γ
2
gamma^(2)(gamma^(2)+gamma+1)=gamma^(4)+gamma^(3)+gamma^(2) \gamma^2(\gamma^2 + \gamma + 1) = \gamma^4 + \gamma^3 + \gamma^2 γ 2 ( γ 2 + γ + 1 ) = γ 4 + γ 3 + γ 2
Since
γ
4
=
γ
+
1
γ
4
=
γ
+
1
gamma^(4)=gamma+1 \gamma^4 = \gamma + 1 γ 4 = γ + 1 , this becomes:
(
γ
+
1
)
+
γ
3
+
γ
2
=
γ
3
+
γ
2
+
γ
+
1
(
γ
+
1
)
+
γ
3
+
γ
2
=
γ
3
+
γ
2
+
γ
+
1
(gamma+1)+gamma^(3)+gamma^(2)=gamma^(3)+gamma^(2)+gamma+1 (\gamma + 1) + \gamma^3 + \gamma^2 = \gamma^3 + \gamma^2 + \gamma + 1 ( γ + 1 ) + γ 3 + γ 2 = γ 3 + γ 2 + γ + 1
Thus, the numerator is
γ
3
+
γ
2
+
γ
+
1
γ
3
+
γ
2
+
γ
+
1
gamma^(3)+gamma^(2)+gamma+1 \gamma^3 + \gamma^2 + \gamma + 1 γ 3 + γ 2 + γ + 1 .
Step 2: Compute the denominator
The denominator is ( (\gamma^3 + \gamma^2)(1 + \gamma
^6) ). First, simplify
1
+
γ
6
1
+
γ
6
1+gamma^(6) 1 + \gamma^6 1 + γ 6 :
γ
6
=
γ
3
+
γ
2
γ
6
=
γ
3
+
γ
2
gamma^(6)=gamma^(3)+gamma^(2) \gamma^6 = \gamma^3 + \gamma^2 γ 6 = γ 3 + γ 2
Thus:
1
+
γ
6
=
1
+
γ
3
+
γ
2
1
+
γ
6
=
1
+
γ
3
+
γ
2
1+gamma^(6)=1+gamma^(3)+gamma^(2) 1 + \gamma^6 = 1 + \gamma^3 + \gamma^2 1 + γ 6 = 1 + γ 3 + γ 2
Now multiply this by
γ
3
+
γ
2
γ
3
+
γ
2
gamma^(3)+gamma^(2) \gamma^3 + \gamma^2 γ 3 + γ 2 :
(
γ
3
+
γ
2
)
(
1
+
γ
3
+
γ
2
)
=
γ
3
+
γ
2
(
γ
3
+
γ
2
)
(
1
+
γ
3
+
γ
2
)
=
γ
3
+
γ
2
(gamma^(3)+gamma^(2))(1+gamma^(3)+gamma^(2))=gamma^(3)+gamma^(2) (\gamma^3 + \gamma^2)(1 + \gamma^3 + \gamma^2) = \gamma^3 + \gamma^2 ( γ 3 + γ 2 ) ( 1 + γ 3 + γ 2 ) = γ 3 + γ 2
Thus, the denominator is
γ
3
+
γ
2
γ
3
+
γ
2
gamma^(3)+gamma^(2) \gamma^3 + \gamma^2 γ 3 + γ 2 .
Step 3: Simplify the expression
The expression becomes:
γ
3
+
γ
2
+
γ
+
1
γ
3
+
γ
2
=
γ
+
1
γ
3
+
γ
2
+
γ
+
1
γ
3
+
γ
2
=
γ
+
1
(gamma^(3)+gamma^(2)+gamma+1)/(gamma^(3)+gamma^(2))=gamma+1 \frac{\gamma^3 + \gamma^2 + \gamma + 1}{\gamma^3 + \gamma^2} = \gamma + 1 γ 3 + γ 2 + γ + 1 γ 3 + γ 2 = γ + 1
Thus, the result is
γ
+
1
γ
+
1
gamma+1 \gamma + 1 γ + 1 , which corresponds to the vector
(
0
,
0
,
1
,
1
)
(
0
,
0
,
1
,
1
)
(0,0,1,1) (0, 0, 1, 1) ( 0 , 0 , 1 , 1 ) .
Question:-2(a)
Decrypt each of the following cipher texts:
i) Text: "CBBGYAEBBFZCFEPXYAEBB", encrypted with affine cipher with key
(
7
,
2
)
(
7
,
2
)
(7,2) (7,2) ( 7 , 2 ) .
ii) Text: "KSTYZKESLNZUV", encrypted with Vigenère cipher with key "RESULT".
Answer:
Let’s solve both cipher texts using their respective decryption methods.
Part (i): Affine Cipher Decryption
For the affine cipher, the encryption is performed using the function:
E
(
x
)
=
(
a
x
+
b
)
mod
m
E
(
x
)
=
(
a
x
+
b
)
mod
m
E(x)=(ax+b)quadmodm E(x) = (ax + b) \mod m E ( x ) = ( a x + b ) mod m
where
a
=
7
a
=
7
a=7 a = 7 a = 7 ,
b
=
2
b
=
2
b=2 b = 2 b = 2 , and
m
=
26
m
=
26
m=26 m = 26 m = 26 (since we’re working with the alphabet). The decryption formula for the affine cipher is:
D
(
y
)
=
a
−
1
(
y
−
b
)
mod
m
D
(
y
)
=
a
−
1
(
y
−
b
)
mod
m
D(y)=a^(-1)(y-b)quadmodm D(y) = a^{-1}(y – b) \mod m D ( y ) = a − 1 ( y − b ) mod m
where
a
−
1
a
−
1
a^(-1) a^{-1} a − 1 is the modular inverse of
a
a
a a a modulo 26, and
b
=
2
b
=
2
b=2 b = 2 b = 2 is the key.
Step 1: Find the Modular Inverse of
a
=
7
a
=
7
a=7 a = 7 a = 7 Mod 26
We need to find
a
−
1
a
−
1
a^(-1) a^{-1} a − 1 such that:
7
⋅
a
−
1
≡
1
mod
26
7
⋅
a
−
1
≡
1
mod
26
7*a^(-1)-=1quadmod26 7 \cdot a^{-1} \equiv 1 \mod 26 7 ⋅ a − 1 ≡ 1 mod 26
Using the extended Euclidean algorithm, we can find that the modular inverse of 7 modulo 26 is 15. Thus:
a
−
1
=
15
a
−
1
=
15
a^(-1)=15 a^{-1} = 15 a − 1 = 15
Step 2: Decrypt the Cipher Text
The cipher text is "CBBGYAEBBFZCFEPXYAEBB". Convert the letters to numbers where
A
=
0
A
=
0
A=0 A = 0 A = 0 ,
B
=
1
B
=
1
B=1 B = 1 B = 1 ,
C
=
2
C
=
2
C=2 C = 2 C = 2 , …,
Z
=
25
Z
=
25
Z=25 Z = 25 Z = 25 . The numeric equivalent of the cipher text is:
CBBGYAEBBFZCFEPXYAEBB
≡
[
2
,
1
,
1
,
6
,
24
,
0
,
4
,
1
,
1
,
5
,
25
,
2
,
5
,
4
,
15
,
23
,
24
,
0
,
4
,
1
,
1
]
CBBGYAEBBFZCFEPXYAEBB
≡
[
2
,
1
,
1
,
6
,
24
,
0
,
4
,
1
,
1
,
5
,
25
,
2
,
5
,
4
,
15
,
23
,
24
,
0
,
4
,
1
,
1
]
“CBBGYAEBBFZCFEPXYAEBB”-=[2,1,1,6,24,0,4,1,1,5,25,2,5,4,15,23,24,0,4,1,1] \text{CBBGYAEBBFZCFEPXYAEBB} \equiv [2, 1, 1, 6, 24, 0, 4, 1, 1, 5, 25, 2, 5, 4, 15, 23, 24, 0, 4, 1, 1] CBBGYAEBBFZCFEPXYAEBB ≡ [ 2 , 1 , 1 , 6 , 24 , 0 , 4 , 1 , 1 , 5 , 25 , 2 , 5 , 4 , 15 , 23 , 24 , 0 , 4 , 1 , 1 ]
Now apply the decryption formula
D
(
y
)
=
15
(
y
−
2
)
mod
26
D
(
y
)
=
15
(
y
−
2
)
mod
26
D(y)=15(y-2)mod26 D(y) = 15(y – 2) \mod 26 D ( y ) = 15 ( y − 2 ) mod 26 to each number:
D
(
2
)
=
15
(
2
−
2
)
mod
26
=
15
⋅
0
mod
26
=
0
D
(
2
)
=
15
(
2
−
2
)
mod
26
=
15
⋅
0
mod
26
=
0
D(2)=15(2-2)mod26=15*0mod26=0 D(2) = 15(2 – 2) \mod 26 = 15 \cdot 0 \mod 26 = 0 D ( 2 ) = 15 ( 2 − 2 ) mod 26 = 15 ⋅ 0 mod 26 = 0 → A
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
15
⋅
(
−
1
)
mod
26
=
15
⋅
25
mod
26
=
375
mod
26
=
11
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
15
⋅
(
−
1
)
mod
26
=
15
⋅
25
mod
26
=
375
mod
26
=
11
D(1)=15(1-2)mod26=15*(-1)mod26=15*25mod26=375mod26=11 D(1) = 15(1 – 2) \mod 26 = 15 \cdot (-1) \mod 26 = 15 \cdot 25 \mod 26 = 375 \mod 26 = 11 D ( 1 ) = 15 ( 1 − 2 ) mod 26 = 15 ⋅ ( − 1 ) mod 26 = 15 ⋅ 25 mod 26 = 375 mod 26 = 11 → L
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
11
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
11
D(1)=15(1-2)mod26=11 D(1) = 15(1 – 2) \mod 26 = 11 D ( 1 ) = 15 ( 1 − 2 ) mod 26 = 11 → L
D
(
6
)
=
15
(
6
−
2
)
mod
26
=
15
⋅
4
mod
26
=
60
mod
26
=
8
D
(
6
)
=
15
(
6
−
2
)
mod
26
=
15
⋅
4
mod
26
=
60
mod
26
=
8
D(6)=15(6-2)mod26=15*4mod26=60mod26=8 D(6) = 15(6 – 2) \mod 26 = 15 \cdot 4 \mod 26 = 60 \mod 26 = 8 D ( 6 ) = 15 ( 6 − 2 ) mod 26 = 15 ⋅ 4 mod 26 = 60 mod 26 = 8 → I
D
(
24
)
=
15
(
24
−
2
)
mod
26
=
15
⋅
22
mod
26
=
330
mod
26
=
18
D
(
24
)
=
15
(
24
−
2
)
mod
26
=
15
⋅
22
mod
26
=
330
mod
26
=
18
D(24)=15(24-2)mod26=15*22mod26=330mod26=18 D(24) = 15(24 – 2) \mod 26 = 15 \cdot 22 \mod 26 = 330 \mod 26 = 18 D ( 24 ) = 15 ( 24 − 2 ) mod 26 = 15 ⋅ 22 mod 26 = 330 mod 26 = 18 → S
D
(
0
)
=
15
(
0
−
2
)
mod
26
=
15
⋅
(
−
2
)
mod
26
=
−
30
mod
26
=
22
D
(
0
)
=
15
(
0
−
2
)
mod
26
=
15
⋅
(
−
2
)
mod
26
=
−
30
mod
26
=
22
D(0)=15(0-2)mod26=15*(-2)mod26=-30mod26=22 D(0) = 15(0 – 2) \mod 26 = 15 \cdot (-2) \mod 26 = -30 \mod 26 = 22 D ( 0 ) = 15 ( 0 − 2 ) mod 26 = 15 ⋅ ( − 2 ) mod 26 = − 30 mod 26 = 22 → W
D
(
4
)
=
15
(
4
−
2
)
mod
26
=
15
⋅
2
mod
26
=
30
mod
26
=
4
D
(
4
)
=
15
(
4
−
2
)
mod
26
=
15
⋅
2
mod
26
=
30
mod
26
=
4
D(4)=15(4-2)mod26=15*2mod26=30mod26=4 D(4) = 15(4 – 2) \mod 26 = 15 \cdot 2 \mod 26 = 30 \mod 26 = 4 D ( 4 ) = 15 ( 4 − 2 ) mod 26 = 15 ⋅ 2 mod 26 = 30 mod 26 = 4 → E
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
11
D
(
1
)
=
15
(
1
−
2
)
mod
26
=
11
D(1)=15(1-2)mod26=11 D(1) = 15(1 – 2) \mod 26 = 11 D ( 1 ) = 15 ( 1 − 2 ) mod 26 = 11 → L
D
(
1
)
=
11
D
(
1
)
=
11
D(1)=11 D(1) = 11 D ( 1 ) = 11 → L
D
(
5
)
=
15
(
5
−
2
)
mod
26
=
15
⋅
3
mod
26
=
45
mod
26
=
19
D
(
5
)
=
15
(
5
−
2
)
mod
26
=
15
⋅
3
mod
26
=
45
mod
26
=
19
D(5)=15(5-2)mod26=15*3mod26=45mod26=19 D(5) = 15(5 – 2) \mod 26 = 15 \cdot 3 \mod 26 = 45 \mod 26 = 19 D ( 5 ) = 15 ( 5 − 2 ) mod 26 = 15 ⋅ 3 mod 26 = 45 mod 26 = 19 → T
D
(
25
)
=
15
(
25
−
2
)
mod
26
=
15
⋅
23
mod
26
=
345
mod
26
=
7
D
(
25
)
=
15
(
25
−
2
)
mod
26
=
15
⋅
23
mod
26
=
345
mod
26
=
7
D(25)=15(25-2)mod26=15*23mod26=345mod26=7 D(25) = 15(25 – 2) \mod 26 = 15 \cdot 23 \mod 26 = 345 \mod 26 = 7 D ( 25 ) = 15 ( 25 − 2 ) mod 26 = 15 ⋅ 23 mod 26 = 345 mod 26 = 7 → H
D
(
2
)
=
15
(
2
−
2
)
mod
26
=
0
D
(
2
)
=
15
(
2
−
2
)
mod
26
=
0
D(2)=15(2-2)mod26=0 D(2) = 15(2 – 2) \mod 26 = 0 D ( 2 ) = 15 ( 2 − 2 ) mod 26 = 0 → A
D
(
5
)
=
19
D
(
5
)
=
19
D(5)=19 D(5) = 19 D ( 5 ) = 19 → T
D
(
4
)
=
4
D
(
4
)
=
4
D(4)=4 D(4) = 4 D ( 4 ) = 4 → E
D
(
15
)
=
15
(
15
−
2
)
mod
26
=
15
⋅
13
mod
26
=
195
mod
26
=
13
D
(
15
)
=
15
(
15
−
2
)
mod
26
=
15
⋅
13
mod
26
=
195
mod
26
=
13
D(15)=15(15-2)mod26=15*13mod26=195mod26=13 D(15) = 15(15 – 2) \mod 26 = 15 \cdot 13 \mod 26 = 195 \mod 26 = 13 D ( 15 ) = 15 ( 15 − 2 ) mod 26 = 15 ⋅ 13 mod 26 = 195 mod 26 = 13 → N
D
(
23
)
=
15
(
23
−
2
)
mod
26
=
15
⋅
21
mod
26
=
315
mod
26
=
3
D
(
23
)
=
15
(
23
−
2
)
mod
26
=
15
⋅
21
mod
26
=
315
mod
26
=
3
D(23)=15(23-2)mod26=15*21mod26=315mod26=3 D(23) = 15(23 – 2) \mod 26 = 15 \cdot 21 \mod 26 = 315 \mod 26 = 3 D ( 23 ) = 15 ( 23 − 2 ) mod 26 = 15 ⋅ 21 mod 26 = 315 mod 26 = 3 → D
D
(
24
)
=
18
D
(
24
)
=
18
D(24)=18 D(24) = 18 D ( 24 ) = 18 → S
D
(
0
)
=
22
D
(
0
)
=
22
D(0)=22 D(0) = 22 D ( 0 ) = 22 → W
D
(
4
)
=
4
D
(
4
)
=
4
D(4)=4 D(4) = 4 D ( 4 ) = 4 → E
D
(
1
)
=
11
D
(
1
)
=
11
D(1)=11 D(1) = 11 D ( 1 ) = 11 → L
D
(
1
)
=
11
D
(
1
)
=
11
D(1)=11 D(1) = 11 D ( 1 ) = 11 → L
Thus, the decrypted message is "ALL IS WELL THAT ENDS WELL" .
Part (ii): Vigenère Cipher Decryption
The Vigenère cipher decryption is performed by subtracting the key’s corresponding letter values from the cipher text, modulo 26.
Step 1: Prepare the Key
The key is "RESULT". We repeat the key to match the length of the cipher text:
Key:
RESULTRESULTRESULT
=
"RESULTRESULT"
Key:
RESULTRESULTRESULT
=
"RESULTRESULT"
“Key: “”RESULTRESULTRESULT”=””RESULTRESULT”” \text{Key: } \text{RESULTRESULTRESULT} = \text{“RESULTRESULT”} Key: RESULTRESULTRESULT = “RESULTRESULT”
Step 2: Convert Text and Key to Numbers
Convert the letters of the cipher text "KSTYZKESLNZUV" and the key "RESULTRESULT" to numbers:
Cipher text:
[
K
,
S
,
T
,
Y
,
Z
,
K
,
E
,
S
,
L
,
N
,
Z
,
U
,
V
]
≡
[
10
,
18
,
19
,
24
,
25
,
10
,
4
,
18
,
11
,
13
,
25
,
20
,
21
]
[
K
,
S
,
T
,
Y
,
Z
,
K
,
E
,
S
,
L
,
N
,
Z
,
U
,
V
]
≡
[
10
,
18
,
19
,
24
,
25
,
10
,
4
,
18
,
11
,
13
,
25
,
20
,
21
]
[K,S,T,Y,Z,K,E,S,L,N,Z,U,V]-=[10,18,19,24,25,10,4,18,11,13,25,20,21] [K, S, T, Y, Z, K, E, S, L, N, Z, U, V] \equiv [10, 18, 19, 24, 25, 10, 4, 18, 11, 13, 25, 20, 21] [ K , S , T , Y , Z , K , E , S , L , N , Z , U , V ] ≡ [ 10 , 18 , 19 , 24 , 25 , 10 , 4 , 18 , 11 , 13 , 25 , 20 , 21 ]
Key:
[
R
,
E
,
S
,
U
,
L
,
T
,
R
,
E
,
S
,
U
,
L
,
T
,
R
]
≡
[
17
,
4
,
18
,
20
,
11
,
19
,
17
,
4
,
18
,
20
,
11
,
19
,
17
]
[
R
,
E
,
S
,
U
,
L
,
T
,
R
,
E
,
S
,
U
,
L
,
T
,
R
]
≡
[
17
,
4
,
18
,
20
,
11
,
19
,
17
,
4
,
18
,
20
,
11
,
19
,
17
]
[R,E,S,U,L,T,R,E,S,U,L,T,R]-=[17,4,18,20,11,19,17,4,18,20,11,19,17] [R, E, S, U, L, T, R, E, S, U, L, T, R] \equiv [17, 4, 18, 20, 11, 19, 17, 4, 18, 20, 11, 19, 17] [ R , E , S , U , L , T , R , E , S , U , L , T , R ] ≡ [ 17 , 4 , 18 , 20 , 11 , 19 , 17 , 4 , 18 , 20 , 11 , 19 , 17 ]
Step 3: Decrypt the Cipher Text
To decrypt, subtract the key value from the cipher text value, modulo 26:
D
(
i
)
=
(
C
(
i
)
−
K
(
i
)
)
mod
26
D
(
i
)
=
(
C
(
i
)
−
K
(
i
)
)
mod
26
D(i)=(C(i)-K(i))quadmod26 D(i) = (C(i) – K(i)) \mod 26 D ( i ) = ( C ( i ) − K ( i ) ) mod 26
Now, decrypt each letter:
D
(
10
−
17
)
mod
26
=
(
−
7
)
mod
26
=
19
D
(
10
−
17
)
mod
26
=
(
−
7
)
mod
26
=
19
D(10-17)mod26=(-7)mod26=19 D(10 – 17) \mod 26 = (-7) \mod 26 = 19 D ( 10 − 17 ) mod 26 = ( − 7 ) mod 26 = 19 → T
D
(
18
−
4
)
mod
26
=
14
D
(
18
−
4
)
mod
26
=
14
D(18-4)mod26=14 D(18 – 4) \mod 26 = 14 D ( 18 − 4 ) mod 26 = 14 → O
D
(
19
−
18
)
mod
26
=
1
D
(
19
−
18
)
mod
26
=
1
D(19-18)mod26=1 D(19 – 18) \mod 26 = 1 D ( 19 − 18 ) mod 26 = 1 → B
D
(
24
−
20
)
mod
26
=
4
D
(
24
−
20
)
mod
26
=
4
D(24-20)mod26=4 D(24 – 20) \mod 26 = 4 D ( 24 − 20 ) mod 26 = 4 → E
D
(
25
−
11
)
mod
26
=
14
D
(
25
−
11
)
mod
26
=
14
D(25-11)mod26=14 D(25 – 11) \mod 26 = 14 D ( 25 − 11 ) mod 26 = 14 → O
D
(
10
−
19
)
mod
26
=
(
−
9
)
mod
26
=
17
D
(
10
−
19
)
mod
26
=
(
−
9
)
mod
26
=
17
D(10-19)mod26=(-9)mod26=17 D(10 – 19) \mod 26 = (-9) \mod 26 = 17 D ( 10 − 19 ) mod 26 = ( − 9 ) mod 26 = 17 → R
D
(
4
−
17
)
mod
26
=
(
−
13
)
mod
26
=
13
D
(
4
−
17
)
mod
26
=
(
−
13
)
mod
26
=
13
D(4-17)mod26=(-13)mod26=13 D(4 – 17) \mod 26 = (-13) \mod 26 = 13 D ( 4 − 17 ) mod 26 = ( − 13 ) mod 26 = 13 → N
D
(
18
−
4
)
mod
26
=
14
D
(
18
−
4
)
mod
26
=
14
D(18-4)mod26=14 D(18 – 4) \mod 26 = 14 D ( 18 − 4 ) mod 26 = 14 → O
D
(
11
−
18
)
mod
26
=
(
−
7
)
mod
26
=
19
D
(
11
−
18
)
mod
26
=
(
−
7
)
mod
26
=
19
D(11-18)mod26=(-7)mod26=19 D(11 – 18) \mod 26 = (-7) \mod 26 = 19 D ( 11 − 18 ) mod 26 = ( − 7 ) mod 26 = 19 → T
D
(
13
−
20
)
mod
26
=
(
−
7
)
mod
26
=
19
D
(
13
−
20
)
mod
26
=
(
−
7
)
mod
26
=
19
D(13-20)mod26=(-7)mod26=19 D(13 – 20) \mod 26 = (-7) \mod 26 = 19 D ( 13 − 20 ) mod 26 = ( − 7 ) mod 26 = 19 → T
D
(
25
−
11
)
mod
26
=
14
D
(
25
−
11
)
mod
26
=
14
D(25-11)mod26=14 D(25 – 11) \mod 26 = 14 D ( 25 − 11 ) mod 26 = 14 → O
D
(
20
−
19
)
mod
26
=
1
D
(
20
−
19
)
mod
26
=
1
D(20-19)mod26=1 D(20 – 19) \mod 26 = 1 D ( 20 − 19 ) mod 26 = 1 → B
D
(
21
−
17
)
mod
26
=
4
D
(
21
−
17
)
mod
26
=
4
D(21-17)mod26=4 D(21 – 17) \mod 26 = 4 D ( 21 − 17 ) mod 26 = 4 → E
Thus, the decrypted message is "TO BE OR NOT TO BE" .