# Affine Cipher over an Affine Cipher

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?

• Well, the key sizes must be different. Otherwise, you can reduce the cascade to one invocation of the base cipher (talking about Vigenère). Jan 13 '16 at 11:54
• Even if the key sizes are different, it reduces to a single Vigenère with a longer key (whose length is the LCM of the lengths of the two keys). Jan 13 '16 at 12:11

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.