RE: Need help with RSA system (C bug likely) 01-07-2015, 03:57 AM
#6
Why are you seeding these random number generators every single time? Do you know how they work? :S You only have to seed it once, meaning you should be keeping a single instance of it instead of generating a seed for a new generator each and every time. Other than that, I tested the values once, and I don't get what you mean about d and e not being calculated correctly.
(d * e) % z == 1 holds true.
Here's an RSA implementation written using the GMP library too: http://www.opensource.apple.com/source/H.../rsa-gmp.c
(d * e) % z == 1 holds true.
Code:
303 * 151 = 45753 / 344 = 133.00290697674419
133 * 344 = 45752
45753 - 45752 = 1Here's an RSA implementation written using the GMP library too: http://www.opensource.apple.com/source/H.../rsa-gmp.c




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)