Question:
Consider an affine cipher (mod 26). You do a chosen plaintext attack using hahaha. The ciphertext is NONONO.?
anonymous
2009-01-22 10:15:33 UTC
Determine the encryption function.
Three answers:
greentunic
2009-01-22 11:00:06 UTC
For an affine cipher, we know that the encryption function is of the form:

e(x) = ax + b (mod 26)



From the given plaintext and corresponding ciphertext, we can see that:

14 = e(8) = 8a + b (mod 26)

15 = e(1) = a + b (mod 26)

(note: 'h' = 8, 'a' = 1, 'N' = 14, 'O' = 15)



So now we just need to solve for a and b. I'll start by subtracting the second equation from the first equation to get:

-1 = 7a (mod 26)

25 = 7a (mod 26)



To get a by itself, we need to determine the multiplicative inverse of 7 mod 26. After some trial and error, we find the the number we are looking for is 15:

7 * 15 = 105 = 1 (mod 26)



So we get:

25 = 7a (mod 26)

25 * 15 = a (mod 26)

a = 375 = 11 (mod 26)



Now plug this value for a back into the second equation:

15 = 11 + b (mod 26)

b = 4 (mod 26)



Thus, the encryption function becomes:

e(x) = 11x + 4 (mod 26)
jhnsnow
2015-08-20 18:02:31 UTC
a=0

n=13
riedinger
2016-11-11 14:48:46 UTC
Kool G Rap, great Daddy Kane, Black concept, Nas, Qwel, and Del the Funky Homosapien. BQ: Mm... Piece of Mine by Gang Starr. BQ2: i don't even understand guy. great question, superb i've got seen in this web site in months.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...