...

View Full Version : RSA encryption function is not working



anurupr
12-14-2010, 06:27 PM
I've been working on RSA encryption using javascript and php for quite some time but i'm not able to do it properly. i'm using the standard RSA.js,BigInt.js and Barrett.js javascript files for the javascript part but the thing that i have noticed is the public exponent is always 10001 or 3 . only then the function works. but the problem is the php file generates a comparatively larger public key exponent. if i use that in the javascript function it crashes. is there anyway out of this ?

bluesages
12-19-2010, 07:08 AM
10001 is hex for 65,537 and is a pretty common public key exponent, per this:

http://en.wikipedia.org/wiki/65537_%28number%29#Applications

Anyway, here's a demo of RSA encryption / decryption using PHP:

http://www.frostjedi.com/terra/dev/rsa/index.php

The source:

http://www.frostjedi.com/terra/dev/rsa/index.txt

It uses phpseclib, a pure PHP RSA implementation (http://phpseclib.sourceforge.net/) and a javascript biginteger library by a guy named Tom Wu (http://www-cs-students.stanford.edu/~tjw/jsbn/).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum