Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
57 views14 pages

Revision V5no

The document contains a series of questions related to cryptography concepts, including types of ciphers, attacks, and the extended Euclidean algorithm for finding multiplicative inverses. It discusses various methods of encryption and decryption, as well as the mathematical processes involved in cryptanalysis. Additionally, it provides examples of calculations related to the multiplicative inverse using the extended Euclidean algorithm.

Uploaded by

morhmany434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views14 pages

Revision V5no

The document contains a series of questions related to cryptography concepts, including types of ciphers, attacks, and the extended Euclidean algorithm for finding multiplicative inverses. It discusses various methods of encryption and decryption, as well as the mathematical processes involved in cryptanalysis. Additionally, it provides examples of calculations related to the multiplicative inverse using the extended Euclidean algorithm.

Uploaded by

morhmany434
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

1.

Each element in the plaintext (bit, letter, group of bits or letters) is mapped into another
element
A) Two-key B) Permutation C) Transposition D) Substitution

2. processes the input one block of elements at a time, producing an output block for
each input block
E) stream cipher F) block cipher G) symmetric H) asymmetric

3. Attack exploits the characteristics of the algorithm to attempt to deduce a


specific plaintext or to deduce the key being used
A) Cryptanalysis B) Brute-force C) Transposition D) asymmetric
attack

4. A keyword is concatenated with the plaintext itself to provide a running key in


E) Playfair Cipher F) Hill Cipher G) Caesar Cipher H) Vigenère
Autokey
Cipher

5. Is a more complex transposition where the message is written in a rectangle, row by


row, and read the message off, column by column, but permute the order of the
columns
I) Playfair J) Rail Fence K) Vernam L) Row
Transposition

6. The statistical structure of the plaintext is dissipated into long-range statistics of the
ciphertext. This is achieved by having each plaintext digit affect the value of many
ciphertext digits
M)Diffusion N) Confusion O) Permutation P) Substitutions

7. One in which information about the key or the plaintext is obtained by observing how
long it takes a given implementation to perform decryptions on various ciphertexts
A) known B) Ciphertext C) Timing attacks D) choose text
plaintext only attack attack
attack
1) Using the extended Euclidean algorithm, find the multiplicative inverse of
𝑎𝑎
a. 135 mod 61 =
𝑏𝑏
b. 42828 mod 6407

𝑎𝑎
q=⌊ ⌋
𝑏𝑏
𝑟𝑟 = 𝑎𝑎 − 𝑏𝑏𝑏𝑏
a b q r
j rj Rj+1 qj+1 Rj+2 xj yj
0 135 61 2 13 1 0
1 61 13 4 9 0 1
2 13 9 1 4 X2 Y2
3 9 4 2 1 X3 Y3
4 1 4 0 X4 Y4
X5 Y5
gcd(135 and 61)=1, there are relatively prime
𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝒙𝒙𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒙𝒙𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝟏𝟏 − 𝟎𝟎 = 𝟏𝟏
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝒚𝒚𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒚𝒚𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝟎𝟎 − 𝟐𝟐 = −𝟐𝟐

j rj Rj+1 qj+1 Rj+2 xj yj


0 135 61 2 13 1 0
1 61 13 4 9 0 1
2 13 9 1 4 1 -2
3 9 4 2 1 X3 Y3
4 1 4 0 X4 Y4
X5 Y5

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟑𝟑 = 𝒙𝒙𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒙𝒙𝟐𝟐
𝒙𝒙𝟑𝟑 = 𝟎𝟎 − 𝟒𝟒 = −𝟒𝟒
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟑𝟑 = 𝒚𝒚𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒚𝒚𝟐𝟐
𝒚𝒚𝟑𝟑 = 𝟏𝟏 − (𝟒𝟒)(−𝟐𝟐) = 𝟗𝟗
j rj Rj+1 qj+1 Rj+2 xj yj
0 135 61 2 13 1 0
1 61 13 4 9 0 1
2 13 9 1 4 1 -2
3 9 4 2 1 -4 9
4 1 4 0 X4 Y4
X5 Y5

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟒𝟒 = 𝒙𝒙𝟐𝟐 − 𝒒𝒒𝟑𝟑 𝒙𝒙𝟑𝟑
𝒙𝒙𝟒𝟒 = 𝟏𝟏 − (𝟏𝟏)(−𝟒𝟒) = 𝟓𝟓
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟒𝟒 = 𝒚𝒚𝟐𝟐 − 𝒒𝒒𝟑𝟑 𝒚𝒚𝟑𝟑
𝒚𝒚𝟒𝟒 = (−𝟐𝟐) − (𝟏𝟏)(𝟗𝟗) = −𝟏𝟏𝟏𝟏

j rj Rj+1 qj+1 Rj+2 xj yj


0 135 61 2 13 1 0
1 61 13 4 9 0 1
2 13 9 1 4 1 -2
3 9 4 2 1 -4 9
4 4 1 4 0 5 -11
5 X5 Y5

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟓𝟓 = 𝒙𝒙𝟑𝟑 − 𝒒𝒒𝟒𝟒 𝒙𝒙𝟒𝟒
𝒙𝒙𝟓𝟓 = (−𝟒𝟒) − (𝟐𝟐)(𝟓𝟓) = −𝟏𝟏𝟏𝟏
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟓𝟓 = 𝒚𝒚𝟑𝟑 − 𝒒𝒒𝟒𝟒 𝒚𝒚𝟒𝟒
𝒚𝒚𝟓𝟓 = (𝟗𝟗) − (𝟐𝟐)(−𝟏𝟏𝟏𝟏) = 𝟑𝟑𝟑𝟑
gcd=ax+by=1
j rj Rj+1 qj+1 Rj+2 xj yj
0 135 61 2 13 1 0
1 61 13 4 9 0 1
2 13 9 1 4 1 -2
3 9 4 2 1 -4 9
4 4 1 4 0 5 -11
5 -14 31

𝟏𝟏𝟏𝟏𝟏𝟏 −𝟏𝟏 𝒎𝒎𝒎𝒎𝒎𝒎 𝟔𝟔𝟔𝟔 = −𝟏𝟏𝟏𝟏 𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎𝒎 = 𝟒𝟒𝟒𝟒


61 mod 135
a-bq

a b q r
j rj Rj+1 qj+1 Rj+2 xj yj
0 26 9 2 8 1 0
1 9 8 1 1 0 1
2 8 1 8 0 X2 Y2
3 X3 Y3

9 mod 26
𝑟𝑟 = 𝑎𝑎 − 𝑏𝑏𝑞𝑞
𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝒙𝒙𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒙𝒙𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝟏𝟏 − 𝟎𝟎 = 𝟏𝟏
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝒚𝒚𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒚𝒚𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝟎𝟎 − 𝟐𝟐 = −𝟐𝟐

J rj Rj+1 qj+1 Rj+2 xj yj


0 26 9 2 8 1 0
1 9 8 1 1 0 1
2 8 1 8 0 1 -2
3 X3 Y3
𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏
𝒙𝒙𝟑𝟑 = 𝒙𝒙𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒙𝒙𝟐𝟐
𝒙𝒙𝟑𝟑 = 𝟎𝟎 − 𝟏𝟏 = −1
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟑𝟑 = 𝒚𝒚𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒚𝒚𝟐𝟐
𝒚𝒚𝟑𝟑 = 𝟏𝟏 − (−𝟐𝟐) = 𝟑𝟑

J rj Rj+1 qj+1 Rj+2 xj yj


0 26 9 2 8 1 0
1 9 8 1 1 0 1
2 8 1 8 0 1 -2
3 -1 3

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟑𝟑 = 𝒙𝒙𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒙𝒙𝟐𝟐
𝒙𝒙𝟑𝟑 = 𝟎𝟎 − 𝟏𝟏 = −1
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟑𝟑 = 𝒚𝒚𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒚𝒚𝟐𝟐
𝒚𝒚𝟑𝟑 = 𝟏𝟏 − (−𝟐𝟐) = 𝟑𝟑

26-1 mod 9=-1


9-1 mod 26=3

b. 42828 mod 6407

j rj Rj+1 qj+1 Rj+2


0 42828 6407 6 4386
1 6407 4386 1 2021
2 4386 2021 2 344
3 2021 344 5 301
344 301 1 43
301 43 7 0
gcd(135 and 61)=43, there are not relatively prime, so the multiplicative
inverse does not exist.
Example: Encrypt the message “hillcipher” using the Hill cipher with the key
𝟑𝟑 𝟐𝟐
� � .Show your calculations and the result.
𝟖𝟖 𝟓𝟓

H I L L C I P H E R
7 8 11 11 2 8 15 7 4 17
7 2 17 25
𝟑𝟑 𝟐𝟐
[𝟕𝟕 𝟖𝟖] � � = [𝟕𝟕 × 𝟑𝟑 + 𝟖𝟖 × 𝟖𝟖 𝟕𝟕 × 𝟐𝟐 + 𝟖𝟖 × 𝟓𝟓]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟓𝟓
= [𝟖𝟖𝟖𝟖 𝟓𝟓𝟓𝟓] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟕𝟕 𝟐𝟐]

𝑟𝑟 = 𝑎𝑎 − 𝑏𝑏𝑞𝑞
𝟑𝟑 𝟐𝟐
[𝟏𝟏𝟏𝟏 𝟏𝟏𝟏𝟏] � � = [𝟏𝟏𝟏𝟏 × 𝟑𝟑 + 𝟏𝟏𝟏𝟏 × 𝟖𝟖 𝟏𝟏𝟏𝟏 × 𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟓𝟓] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟓𝟓
= [121 77] mod 26 = [17 25]

𝟑𝟑 𝟐𝟐
[𝟐𝟐 𝟖𝟖] � � = [𝟐𝟐 × 𝟑𝟑 + 𝟖𝟖 × 𝟖𝟖 𝟐𝟐 × 𝟐𝟐 + 𝟖𝟖 × 𝟓𝟓] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟓𝟓
= [70 44] mod 26 = [18 18]

𝟑𝟑 𝟐𝟐
[𝟏𝟏𝟏𝟏 𝟕𝟕] � � = [𝟏𝟏𝟏𝟏 × 𝟑𝟑 + 𝟕𝟕 × 𝟖𝟖 𝟏𝟏𝟏𝟏 × 𝟐𝟐 + 𝟕𝟕 × 𝟓𝟓] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟓𝟓
= [101 65] mod 26 = [23 13]

𝟑𝟑 𝟐𝟐
[𝟒𝟒 𝟏𝟏𝟏𝟏] � � = [𝟒𝟒 × 𝟑𝟑 + 𝟏𝟏𝟏𝟏 × 𝟖𝟖 𝟒𝟒 × 𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟓𝟓] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟓𝟓
= [148 93] mod 26 = [18 15]

The ciphertext HCRZSSXNSP.

To decrypt the ciphertext HCRZSSXNSP using the Hill cipher with the
𝟑𝟑 𝟐𝟐
key 𝑲𝑲 = � � .Show your calculations and the result.
𝟖𝟖 𝟓𝟓
𝟑𝟑 𝟐𝟐
𝐝𝐝𝐝𝐝𝒕𝒕 � � = 3 × 5 − 8 × 2 = −1 𝑚𝑚𝑚𝑚𝑚𝑚 26 = 25
𝟖𝟖 𝟓𝟓

-1/26=-0.12692
q=-1
r=a-bq=-1-(-1)(26)=-1+26=25

Because 26 and 25 relatively prime, therefore there is A-1

j rj Rj+1 qj+1 Rj+2 xj yj


0 26 25 1 1 1 0
1 25 1 25 0 0 1
2 X2 Y2
3

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟐𝟐 = 𝒙𝒙𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒙𝒙𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝟏𝟏 − 𝟎𝟎 = 𝟏𝟏
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝒚𝒚𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒚𝒚𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝟎𝟎 − 𝟏𝟏 = −𝟏𝟏
−𝟏𝟏 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = 𝟐𝟐𝟐𝟐

25-1 mod 26 =25 , because 25 *25 = 27 mod 26 = 1

𝟑𝟑 𝟐𝟐
� �
𝟖𝟖 𝟓𝟓

A-1 mod 26 =(det(A))-1 adj(A)


𝟓𝟓 −𝟐𝟐 𝟓𝟓 𝟐𝟐𝟐𝟐 𝟏𝟏𝟏𝟏𝟏𝟏 𝟔𝟔𝟔𝟔𝟔𝟔 𝟐𝟐𝟐𝟐 𝟐𝟐
A-1 mod 26 =25� �= 25� �=� �=� �
−𝟖𝟖 𝟑𝟑 𝟏𝟏𝟏𝟏 𝟑𝟑 𝟒𝟒𝟒𝟒𝟒𝟒 𝟕𝟕𝟕𝟕 𝟖𝟖 𝟐𝟐𝟐𝟐

H C R Z S S X N S P
7 2 17 25 18 18 23 13 18 15
7 8
𝟐𝟐𝟐𝟐 𝟐𝟐
[𝟕𝟕 𝟐𝟐] � � = [𝟕𝟕 × 𝟐𝟐𝟐𝟐 + 𝟐𝟐 × 𝟖𝟖 𝟕𝟕 × 𝟐𝟐 + 𝟐𝟐 × 𝟐𝟐𝟐𝟐]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟐𝟐𝟐𝟐
= [𝟏𝟏𝟏𝟏𝟏𝟏 𝟔𝟔𝟔𝟔] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟕𝟕 𝟖𝟖]
𝟐𝟐𝟐𝟐 𝟐𝟐
[𝟏𝟏𝟏𝟏 𝟐𝟐𝟐𝟐] � � = [𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐 + 𝟐𝟐𝟐𝟐 × 𝟖𝟖 𝟏𝟏𝟏𝟏 × 𝟐𝟐 + 𝟐𝟐𝟐𝟐 × 𝟐𝟐𝟐𝟐]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟐𝟐𝟐𝟐
= [𝟓𝟓𝟓𝟓𝟓𝟓 𝟔𝟔𝟔𝟔𝟔𝟔] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟏𝟏𝟏𝟏 𝟏𝟏𝟏𝟏]
𝟐𝟐𝟐𝟐 𝟐𝟐
[𝟏𝟏𝟏𝟏 𝟏𝟏𝟏𝟏] � � = [𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟖𝟖 𝟏𝟏𝟏𝟏 × 𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟐𝟐𝟐𝟐
= [𝟓𝟓𝟓𝟓𝟓𝟓 𝟒𝟒𝟒𝟒𝟒𝟒] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟐𝟐 𝟖𝟖]
𝟐𝟐𝟐𝟐 𝟐𝟐
[𝟐𝟐𝟐𝟐 𝟏𝟏𝟏𝟏] � � = [𝟐𝟐𝟐𝟐 × 𝟐𝟐𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟖𝟖 𝟐𝟐𝟐𝟐 × 𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟐𝟐𝟐𝟐
= [𝟓𝟓𝟓𝟓𝟓𝟓 𝟑𝟑𝟑𝟑𝟑𝟑] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟏𝟏𝟏𝟏 𝟕𝟕]
𝟐𝟐𝟐𝟐 𝟐𝟐
[𝟏𝟏𝟏𝟏 𝟏𝟏𝟓𝟓] � � = [𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟖𝟖 𝟏𝟏𝟏𝟏 × 𝟐𝟐 + 𝟏𝟏𝟏𝟏 × 𝟐𝟐𝟐𝟐]𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐
𝟖𝟖 𝟐𝟐𝟐𝟐
= [𝟒𝟒𝟒𝟒𝟒𝟒 𝟑𝟑𝟑𝟑𝟑𝟑] 𝒎𝒎𝒎𝒎𝒎𝒎 𝟐𝟐𝟐𝟐 = [𝟒𝟒 𝟏𝟏𝟏𝟏]

The plaintext “hillcipher”

Encrypt the message “meet me at the usual place at ten rather than eight o clock”
7 3
a. Using the Hill cipher with the key � �. Show your calculations and
2 5
the result.
b. Show the calculations for the corresponding decryption of the ciphertext
to recover the original plaintext.

𝟕𝟕 𝟑𝟑
𝐝𝐝𝐝𝐝𝒕𝒕 � � = 7 × 5 − 3 × 2 = 29 𝑚𝑚𝑚𝑚𝑚𝑚 26 = 3
𝟐𝟐 𝟓𝟓

j rj Rj+1 qj+1 Rj+2 xj yj


0 26 3 8 2 1 0
1 3 2 1 1 0 1
2 2 1 2 0 X2 Y2
3 X3 Y3

Because 26 and 3 are relatively prime, therefore there is A-1

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟐𝟐 = 𝒙𝒙𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒙𝒙𝟏𝟏
𝒙𝒙𝟐𝟐 = 𝟏𝟏 − 𝟎𝟎 = 𝟏𝟏
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝒚𝒚𝟎𝟎 − 𝒒𝒒𝟏𝟏 𝒚𝒚𝟏𝟏
𝒚𝒚𝟐𝟐 = 𝟎𝟎 − 𝟖𝟖 = −𝟖𝟖

j rj Rj+1 qj+1 Rj+2 xj yj


0 26 3 8 2 1 0
1 3 2 1 1 0 1
2 2 1 2 0 1 -8
3 X3 Y3

𝒙𝒙𝒋𝒋 = 𝒙𝒙𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒙𝒙𝒋𝒋−𝟏𝟏


𝒙𝒙𝟑𝟑 = 𝒙𝒙𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒙𝒙𝟐𝟐
𝒙𝒙𝟑𝟑 = 𝟎𝟎 − (𝟏𝟏)(𝟏𝟏) = −1
𝒚𝒚𝒋𝒋 = 𝒚𝒚𝒋𝒋−𝟐𝟐 − 𝒒𝒒𝒋𝒋−𝟏𝟏 𝒚𝒚𝒋𝒋−𝟏𝟏
𝒚𝒚𝟑𝟑 = 𝒚𝒚𝟏𝟏 − 𝒒𝒒𝟐𝟐 𝒚𝒚𝟐𝟐
𝒚𝒚𝟑𝟑 = 𝟏𝟏 − (𝟏𝟏)(−𝟖𝟖) = 𝟗𝟗

3−1 𝑚𝑚𝑚𝑚𝑚𝑚 26 = 9

3-1 mod 26 =9 , because 3*9 = 27 mod 26 = 1

A-1 mod 26 =(det(A))-1 adj(A)

𝟓𝟓 −𝟑𝟑 𝟓𝟓 𝟐𝟐𝟐𝟐 𝟒𝟒𝟒𝟒 𝟐𝟐𝟐𝟐𝟐𝟐 𝟏𝟏𝟏𝟏 𝟐𝟐𝟐𝟐


A-1 mod 26 =9� �= 9� �=� �=� �
−𝟐𝟐 𝟕𝟕 𝟐𝟐𝟐𝟐 𝟕𝟕 𝟐𝟐𝟐𝟐𝟐𝟐 𝟔𝟔𝟔𝟔 𝟖𝟖 𝟏𝟏𝟏𝟏
Using the Vigenère cipher, encrypt the word “cryptographic” using the word
“eng”.

Key e n g e n g e n g E n g e
Plaintext c r y p t o g r a P h i c
ciphertext g e e t g u k e g T u o g

Key 4 13 6 4 13 6 4 13 6 4 13 6 4
Plaintext 2 17 24 15 19 14 6 17 0 15 7 8 2
ciphertext 6 30 30 19 32 20 10 30 6 19 20 14 6
4 4 6 4

Using the Vigenère Autokey cipher, encrypt the message “The enemy will
start the attack at six in the morning” using the word “science”.

science
The enemy will start the attack at six in the morning

Key s c i e n c e t h e e n e m y w i l l s t a r t t h e a t t
Plaintext t h e e n e m y w i l l s t a r t t h e a t t a k a t s i x
ciphertext

Key
Plaintext
ciphertext
Using the S-DES cipher, encrypt the plaintext 10111010 using the key
1011000101. Show all your calculations in steps.
Given that
P10
3 5 2 7 4 10 1 9 8 6

P8
6 3 7 4 8 5 10 9

IP
2 6 3 1 4 8 5 7
E/P
4 1 2 3 2 3 4 1

01 00 11 10 00 01 10 11
11 10 01 00 10 00 01 11
𝑆𝑆0 = � � 𝑆𝑆1 = � �
00 10 01 11 11 00 01 00
11 01 11 10 10 01 00 11

P4
2 4 3 1
IP-1
4 1 3 5 7 2 8 6

Block diagrams

You might also like