toebes / ciphers

Cipher Generators
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link

Affine documentation should ask for coprime $a$, not non-coprime $a$ #366

Closed jlwether closed 1 year ago

jlwether commented 1 year ago

I realize that the affine ciphers are not currently in use, but it still seems like a good idea to avoid propagating bad math.

Wikipedia tells us that, "In mathematics, two integers a and b are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1.

As explained in the Test Guidance for the Affine Cipher, the list of valid, invertible values for a mod 26 is 1,3,5,7,9,11,15,17,19,21,23,25. This is the list of values that are coprime to 26, so it is incorrect to say, "Pick a value for a which is not coprime with 26".

toebes commented 1 year ago

Good point. We will work it into the next update.