Skip to content

danmi1258/phpseclib-jsbn-rsa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpseclib-jsbn-rsa

An example on how to use the jsbn javascript library to encrypt data using RSA and decrypt it in PHP using phpseclib.

  • To generate a new key pair load 'generate.php'. Next copy/paste the private key that is displayed into 'index.php' (you can't miss what needs to be replaced). This way you can just place the project somewhere on a web server supporting PHP and use it.

  • This example just shows you how to do the encryption and decryption using these libraries. Important here is that jsbn expects the public key to be in hex, rather than the OpenSSL type notation generated by phpseclib.

Take a look at rsa-javascript-php if you need a more complete library that also supports different PHP encrytion methods. Although you will probably need to apply the above remark (jsbn requiring a hex public key) to get it to work.

Finally this project used the JQuery and Twitter Bootstrap to do the heavy lifting and make the example page look reasonably good.

About

An example on how to use javascript (jsbn) to encrypt data and decrypt it in PHP using phpseclib.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 95.4%
  • JavaScript 4.6%