Documentation

RSA.php

Pure-PHP PKCS#1 (v2.1) compliant implementation of RSA.

PHP version 5

Here's an example of how to encrypt and decrypt text with this library:

createKey()); $plaintext = 'terrafrost'; $rsa->loadKey($privatekey); $ciphertext = $rsa->encrypt($plaintext); $rsa->loadKey($publickey); echo $rsa->decrypt($ciphertext); ?>

Here's an example of how to create signatures and verify signatures with this library:

createKey()); $plaintext = 'terrafrost'; $rsa->loadKey($privatekey); $signature = $rsa->sign($plaintext); $rsa->loadKey($publickey); echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified'; ?>
Tags
category

Crypt

author

Jim Wigginton terrafrost@php.net

copyright

2009 Jim Wigginton

license

http://www.opensource.org/licenses/mit-license.html MIT License

link
http://phpseclib.sourceforge.net

Interfaces, Classes and Traits

RSA
Pure-PHP PKCS#1 compliant implementation of RSA.

Search results