A Reversible Encryption Routine for PHP
By Tony Marston2005-04-15
Using the Encryption Class
require 'std.encryption.class.inc';To encrypt a string you must supply the string and a key. The string length is optional. Note that before you write this to your database you should use the addslashes() command to deal with any special characters.
$crypt = new Encryption;
$encrypt_result = $crypt->encrypt($key, $password, $pswdlen);To decrypt a string you must supply the string and the key that was used to encrypt it.
$errors = $crypt->errors;
$decrypt_result = $crypt->decrypt($key, $password);
$errors = $crypt->errors;
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "A Reversible Encryption Routine for PHP"
You must be logged in to post a comment.
Link to This Tutorial Page!

