I'm trying to crack an affine cipher, but when cracking I cannot find the inverse of a number because the GCD is not 1. This is my plaintext and this is my ciphertext:
PLAIN: 072097 108108
CIPHER: 024328 164193
This is my function:
E(x) = ax + b (MOD 256256)
Gives:
E(072097) = 072097a + b (MOD 256256) = 024328
E(108108) = 108108a + b (MOD 256256) = 164193
So if we subtract these we get this:
139865 = 36012a (MOD 256256)
a = 139865 / 36012 (MOD 256256)
a = 139865 * 36012^-1 (MOD 256256)
Now GCD(256256, 36012) = 4. So there's no inverse because the GCD is not one.
I'm sure it's possible to crack this text but I just don't know how to do it because there's no inverse of 36012 and 256256.
Does anybody know how to crack this or get the inverse of 36012?