Questions tagged [jsbn]

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers. More info: http://www-cs-students.stanford.edu/~tjw/jsbn/

20 questions
0
votes
1 answer

jsbn.js BigInteger - how to instantiate with a normal number?

I tried both : var a = new BigInteger(5); And var b = new BigInteger(5, 10); But both give me the error: TypeError: 'undefined' is not an object (evaluating 'b.nextBytes') bnpFromNumberjsbn2.js:126 Can you only instantiate with strings?
user429620
0
votes
2 answers

Encryption compatibility between SJCL and java Bouncy Castle RSA

I am working on an android application using RSA encryption. I can get from my server, my private key and my friends public key. Private key are like this: {"n":"...","d":"...","p":"...","q":"...","dmp1":"...","dmq1":"...","coeff":"..."} (jsbn json…
Urriel
  • 11
  • 1
  • 5
0
votes
1 answer

RSA encryption AND decryption with JS AND PHP

Is it possible to encrypt a message with a public key in PHP, then decrypt it with the private key in JS? I've found a few different RSA encryption scripts for PHP and jQuery, but none of them seem to work both ways. Maybe i'm going about it all…
NotSoSmart
  • 89
  • 12
0
votes
1 answer

Unable to properly encrypt data in Javascript using jsbn

I am having trouble encrypting data in JavaScript using Tom Wu's jsbn library. I wind up with an encrypted data, however when I try and decrypt the data on PHP, openssl_private_decrypt returns false. Is it possible the way that I am encoding the…
Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
0
votes
1 answer

RSA in javascript different from PHP

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 =…
Summer Nguyen
  • 229
  • 3
  • 14
1
2