We want to extend the affine cipher such that we can encrypt and decrypt message
ID: 3865001 • Letter: W
Question
We want to extend the affine cipher such that we can encrypt and decrypt messages written with the full German alphabet. The German alphabet consists of the English one together with the three umlauts, A, O, U, and the (even stranger) "double s" character B. We use the following mapping from letters to integers: What are the encryption and decryption equations for the cipher? How large is the key space of the affine cipher for this alphabet? The following ciphertext is encrypted using the key (a = 17 and b = 1). What is the corresponding plaintext?Explanation / Answer
1.
Encryption
The first step in the encryption process is to transform each of the letters in the plaintext alphabet to the corresponding integer in the range 0 to 29. With this done, the encryption process for each letter is given by
E(x) = (ax + b) mod 30
where a and b are the key for the cipher. This means that we multiply our integer value for the plaintext letter by a, and then add b to the result. Finally, we take this modulus m (that is we take the remainder when the solution is divided by m, or we take away the length of the alphabet until we get a number less than this length).
Decryption
In deciphering the ciphertext, we must perform the opposite (or inverse) functions on the ciphertext to retrieve the plaintext. Once again, the first step is to convert each of the ciphertext letters into their integer values. We must now perform the following calculation on each integer
D(x) = c(x - b) mod 30
where c is the modular multiplicative inverse of a. That is, a x c = 1 mod m (c is the number such that when you multiply a by it, and keep taking away the length of the alphabet, you get to 1).
2.
E(x) = (ax + b) mod 30, where gcd(a, 30) = 1 must be for invertibility. Hence 8 ( a = 1, 7, 11, 13, 17, 19, 23, 29) choices for a and 30 for b, that’s altogether 8 · 30 = 240.
3.
Given Key a = 17 , b = 1
Find the inverse of a = 23 since 23 * 17 = 1 mod 30.
We must now perform the inverse calculations on the integer values of the ciphertext. In this case, the calculation in 23(y-b) = 23(y-1).
Ciphertext
A tilde
u
w
y
26
20
29
22
29
23(y-1)
23(26-1) = 575
23(20-1) = 207
23(29-1) = 644
23(22-1) = 483
23(29-1) = 644
23(y-1)mod 30
5
27
14
3
14
Plaintext
F
O`( o tilde)
O
D
O
Ciphertext
A tilde
u
Betaw
Betay
26
20
29
22
29
23(y-1)
23(26-1) = 575
23(20-1) = 207
23(29-1) = 644
23(22-1) = 483
23(29-1) = 644
23(y-1)mod 30
5
27
14
3
14
Plaintext
F
O`( o tilde)
O
D
O
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.