dev-master
9999999-devEasy to use and integrate API for using RSA encrypted values during HTTP communication.
BSD 3-Clause License
The Requires
- php >=5.3.0
- phpseclib/phpseclib dev-master
Wallogit.com
2017 © Pedro Peláez
Easy to use and integrate API for using RSA encrypted values during HTTP communication.
A simple framework for RSA encryption of form field values in browser - server communication using Javascript and PHP., (*1)
You will need a server with PHP 5.3 installed and a web browser that does not choke on more complicated javascript code., (*2)
Install via composer, (*3)
composer install trenker/simple-rsa
Now you can create a key pair like this:, (*4)
require 'vendor/autoload.php'; $key = \RSA\KeyPair::createNew();
On the client side, include the rsa.js file (or the rsa.min.js file if you want to keep it small)., (*5)
You can autoload the rsa scripts using the JavascriptHelper::getFrontendUrl function, (*6)
This will publish the the minified script to an accessible location. By default it is DOCUMENT_ROOT/scripts/rsa.min.MTIME_TIMESTAMP.js. This can easily be adjusted using the arguments or the function. Please take a look into the source file for details, (*7)
After the script tag, that loads the rsa.js file you can use $key->toJavascript(); function to create a code snippet that takes care of setting the values and creating an instance.
eg:, (*8)
For a full example see the demo/index.php file, (*9)
This one is provided under the terms of the GPL v3. See the FSF GPL website for details., (*10)
This library includes the following tools:, (*11)
Easy to use and integrate API for using RSA encrypted values during HTTP communication.
BSD 3-Clause License