Another Modulus (Modulo math) question...
Don M
Posts: 1,652
I am looking at this equation:
e * d = 1(mod(p - 1) * (q - 1))
I need to solve for d. I know ahead of time that:
e = 7
p = 17
q = 11
So the equation now looks like this:
7 * d = 1(mod(17 - 1) * (11 - 1))
or
7 * d = 1(mod160)
According to the article I'm reading the answer is d = 23. I can't figure out how they get that and they don't tell you.
If I do 1(mod160) I get the answer of 1 so I want to try and solve it backwards as 1(mod160) / 7 = d but that doesn't work.
Can someone help me understand this ? I'd like to put it into a spin equation if possible.
Thanks.
Don
e * d = 1(mod(p - 1) * (q - 1))
I need to solve for d. I know ahead of time that:
e = 7
p = 17
q = 11
So the equation now looks like this:
7 * d = 1(mod(17 - 1) * (11 - 1))
or
7 * d = 1(mod160)
According to the article I'm reading the answer is d = 23. I can't figure out how they get that and they don't tell you.
If I do 1(mod160) I get the answer of 1 so I want to try and solve it backwards as 1(mod160) / 7 = d but that doesn't work.
Can someone help me understand this ? I'd like to put it into a spin equation if possible.
Thanks.
Don
Comments
When you write "1(mod160)" is that the same as Spin's:
?
For the equation:
Won't y equal 1 for all legal values of x except when x equals 1?
I feel like I'm missing something.
electrodude
-Phil
Duane- Here's the link- http://blogs.msdn.com/b/plankytronixx/archive/2010/10/23/crypto-primer-understanding-encryption-public-private-key-signatures-and-certificates.aspx
The equations in question are about 1/3 down the page.
How do you solve for d ?
You are correct. I'd appreciate any input you could provide. Trying to see if this is possible using the Propeller.
What numbers == 1 mod 160? Well, let's see: 161, 321, 481, ... So
Pick one whose solution for d is an integer.
-Phil
Phil- I don't understand your answer here. If you look back at the #1 post I mentioned that the article I was reading (posted in #5 above) says the answer is 23. So now using your format how do you get 23 as an answer to that equation? Sorry not trying to be silly here but I don't understand how it's done.
d * 7 = 161
=> d = 161 / 7
=> d = 23
with a variant of Euclid's algorithm.
http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Computing_multiplicative_inverses_in_modular_structures
7 * 23 = 161
161(mod 160) = 1
or
160+1=161
161/7=23
d=23
modulo is just the remainder after a division... am I missing something about what was asked?
d=23
-Phil
I swear I never saw r.daneel's answer... but, yes... indeed.