note 47904 deleted from ref.mcrypt by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 05 Dec 2004 02:32:42 +0000 |
| Subject: | note 47904 deleted from ref.mcrypt by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81373@lists.php.net to get a copy of this message | ||
Note Submitter: Richard at maxixs dot com
----
With the functions from "Anonymous" from 20th Nov, I really had the solution for my thing.
One extra solution, in case of password checking etc on 'open source' programs where you
can't set a fixed key, the input itself can also be the key!
You will have this then (with the mentioned function):
<?
/* for encryption */
$input = "MyPassword";
$encrypted = Encrypt($input,$input);
/* for decryption */
$decrypted = Decrypt($encrypted,$input);
if ($decrypted == $input) {
echo "Password correct!";
}
?>
Very valuable!
Cheers,
Richard