Problem 44956. Determine RSA keys (public and private) given two prime number character strings (p and q)
I get different results for d in test cases 2, 3, and 4 (in particular, d=929660805638728623653 for test case 2).
If I understand correctly, we should have mod(d*e,phi)=1, where phi=(p-1)*(q-1). My answers seem to satisfy that condition, but test cases 2, 3, and 4 do not.
Could someone help me out with the modular inversion. I can't seem to get it to work for any large numbers. I've been stuck for a while
I think my main issue is that I cannot use the mod function with large numbers, what is a way around this?
@David Hill. Thanks, that worked a lot better for me
One should first consider if MATLAB is even adapted for these kinds of calculations. Still, I had a lot of fun.
Solution CommentsShow comments
Problem Recent Solvers13
Numbers with prime factors 2, 3 and 5.
Sum of first n terms of a harmonic progression
Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
More from this Author50
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!