A bit more RSA
I really don't like when I do not understand anyone's code, so it takes me a bit of effort till I do my own homework to create my own version of things I can understand. Being a teacher, I always find troubling not to be able to explain things to my students, so I used some time to create my very own RSA implementation. I've found a very good reference text here . My perl program takes three parameters data, encryption (or decryption) exponent and module and it returns the encrypted (or decrypted) version. As it uses BigInt library it should be happy dealing with any of your big numbers. You can find a Java implementation in the above mentioned text too. #!/usr/bin/perl use Math::BigInt; if($#ARGV<2) {print "Usage: exp, module\n"; exit 2;} $a = Math::BigInt->new($ARGV[0]); $b = Math::BigInt->new($ARGV[1]); $c = Math::BigInt->new($ARGV[2]); print "out=".($dec = $a->bmodpow($b,$c))."\n"; Contrary to what may look, bmodp