Affine cipher

cosmos 6th July 2017 at 12:43pm
Cipher

intro

Using Modular arithmetic:

encryption: y=ax+b mod26y=ax+b \text{ mod} 26

decryption: x=a1(yb) mod26x=a^{-1}(y-b) \text{ mod} 26

aa has to be Coprime with 2626 (i.e. gcd(a,26)=1gcd(a,26)=1 for a1a^{-1} to exist

Key space is small, so Brute-force attack is very easy, and also frequency analysis. So it's not secure