Really simple question regarding the Affine Cipher.
Can someone tell me how $3^{-1}$ is supposed to result in 9 in the following explanation below?
Really simple question regarding the Affine Cipher.
Can someone tell me how $3^{-1}$ is supposed to result in 9 in the following explanation below?
If you want to find the multiplicative inverse of an integer a (mod n) you can use the extended Euclidean algorithm. For two integers a and b, the Extendend Euclidean Algorithm not only calculate the greatest common divisor d but also two integers x and y that satisfy the following equation:
ax + by = d = gcd(a,b) (where gcd is the greatest common divisor)
So if a and b are relatively prime (gcd(a,b)=1), x is the multiplicative inverse of a (mod y), and y is the multiplicative inverse of b (mod x).
Wikipedia seems to provide a good explanation of the algorithm
Hope I was helpful!