Réf. : ASCII, RSA AND BIGNUM

Tad wrotes:

First, note that 100 base 10 = 1100100 base 2,

so that 100**100 = (100**64) * (100**32) * (100**4)

Now calculate,

25800**1 mod 257 = 100
100**2 mod 257 = 100*100 mod 257 = 235
100**4 mod 257 = 235*235 mod 257 = 15
100**8 mod 257 = 15*15 mod 257 = 225
100**16 mod 257 = 225*225 mod 257 = 253
100**32 mod 257 = 253*253 mod 257 = 16
100**64 mod 257 = 16 * 16 mod 257 = 256

Then,

A = ((256 * 16) mod 257) * (15 mod 257)

A= ( 241 * 15) mod 257

So, the answer is A=17

I think that is exactly what the method ** in class BN of OpenSSL does.
When implementing RSA there other useful methods like mod_mul(), prime_fasttest() and gcd() in this class.

Regards,
Roland

···

________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: E-Mail-Adresse erstellen kostenlos | FreeMail