Wednesday, September 20, 2006

Im very happy in my number theory class , my professor was explaining multiplicative functions , like sigma or phi for integers , my professor told us about RSA , and if someone knew how it worked , of course i love RSA and the theory behind , and i made a program for "demo" im not using my big int library because is just for "showing" how the theory converts into something practic and not magic. i implemented modular exponentiation , greatest common divisor using euclid's algorithm and extended euclid's algorithm with an easy recursive function, is not very commented but the 'print f's explain how rsa works , it just encrypts the number "111" (you can change it) and then decrypts the same number , as i said before , is just for showing , as an argument the rsa function receives the 2 prime numbers to generate the keys, i made this very fast. so ill comment it later.

i hope someone can test it and i hope it can be useful as it was for me.

note: i just accept 2 primes such that the product is bigger than 111 and less than 7800^2 (im using just the processor registers no memory , if you want to check with a more complicated and serius implementation check my rsa implementation for no educational purposes (because it has more computer science than math hehe) using lightMP.

link here

RSA demo

Eduardo Ruiz Duarte