# Thread: code breaking modular encryptions

1. ## code breaking modular encryptions

I can not figure out this problem and it is starting to annoy me!

So far I have got (may be wrong)
1.

L encrypted as J implies 12 a + b ≅ 10 mod 26

G encrypted as C implies 7a + b 3 mod 26

my set of notes then say to subtract the first congruence from the 2nd which gave me:

-5 a ≅ -7 mod 26

keep getting mixed up after here when trying to find the value of a and b

any help would be greatly appreciated
question is as follows:

2. ## Re: code breaking modular encryptions

tried it again and got it wrong. for the first encrypted word "PTU" i got JVY and the last time i checked Jvy is not a word a normal person would use in a sentence

3. ## Re: code breaking modular encryptions

Unless you have miswritten one of the equations, subtracting the second equation from the first gives you -7a= -5 (mod 26). There is no 'b' in the equation- the whole point of subtracting is to eliminate b. That is the same as 7a= 5 (mod 26). We can write that as 7a= 5+ 26n and then as 7a- 26n= 5.

Now, 7 divides into 26 three times with remainder 5: 26- 3(7)= 7(-3)- 26(-1)= 5. So we can take a= -3. If you want it between 0 and 26, -3 is congruent to 26-3= 23 (mod 26).

That is, 7(23)= 161= 6(26)+ 5. We can take a= 23.

Now, go back to 3a+ b= 7 (mod 26). With a= 23, that is 3(23)= 69+ b= 17+ b= 7(mod 26) so b= 7- 17= -10= 16 (mod 26).

4. ## Re: code breaking modular encryptions

i tried to make the decryption map work as y ≅ (23x + 16) mod 26: (using your a = 23 and b = 16)

23x + 16 ≅ y mod 26
-> 23x ≅ (y - 16) mod 26

but when i tried to find the inverse of 23 i couldn't

23z ≅ 1 mod 26
23z ≅ 27 mod 26
23z ≅ 53 mod 26
23z ≅ 79 mod 26
etc

by the way, the example i was following said to subtract the first congruence from the 2nd:

L encrypted as J implies 12 a + b ≅ 10 mod 26

G encrypted as C implies 7a + b 3 mod 26

=

-5 a ≅ -7 mod 26