8

I would like to know your view about the title, encrypting a plain text with an affine cipher then encrypting that ciphertext once more using the same cipher, but of course different keys. Would it be more secure?

For me, it won't be since it still can be brute forced. That's what I think, and I have read about Vigenère over a Vigenère, so practically they would be the same case, right?

Patriot
  • 3,162
  • 3
  • 20
  • 66
rockStar
  • 183
  • 1
  • 4

1 Answers1

14

If you combine two affine ciphers, you obtain one affine cipher. Say the first cipher is $e_1(x) = a_1x+b_1$ and the second is $e_2(x) = a_2x+b_2$. Then $e_1(e_2(x)) = a_1(a_2x+b_2)+b_1 = (a_1a_2)x+(a_1b_2+b_1)$.

Note that if $a_1$ and $a_2$ are both relatively prime with the modulus, then so is $a_1a_2$, so the new cipher can also be deciphered.

fkraiem
  • 8,242
  • 2
  • 28
  • 38