I have a problem with RSA now. I have same modulus and exponent in Javascript and PHP., both use PKCS#1 in javascript, I use http://www-cs-students.stanford.edu/~tjw/jsbn/rsa.js
var rsa = new RSAKey();
rsa.setPublic("modulus","ex");
var result = rsa.encrypt(text);
and in PHP, I use http://phpseclib.sourceforge.net/
require_once 'Crypt/RSA.php';
$rsa = new Crypt_RSA();
$n="modulus";
$e="ex";
$rsa->modulus= new Math_BigInteger($n,16);
$rsa->publicExponent= new Math_BigInteger($e,16);
$key=$rsa->getPublicKey();
$rsa->loadKey($key);
$rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);
$ciphertext = $rsa->encrypt("1234");
echo bin2hex($ciphertext);
But 2 result are different. Can any please tell me the reason. Thank you very much