|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-01-08 06:51 UTC] sas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Using libmcrypt-2.2.4, PHP 4 (Latest CVS) as Apache 1.3.9 module. Extra chars are being added either at the encryption or decryption stage using mcrypt_ecb(). This script is an adaption of the script in the PHP manual. <?php $key = "this_is_my_key"; $input = "123456789"; printf ("Input Text: %s Count:%s\n", $input, strlen($input)); $encrypted_data = mcrypt_ecb(MCRYPT_TripleDES, $key, $input, MCRYPT_ENCRYPT); $decrypted_data = mcrypt_ecb(MCRYPT_TripleDES, $key, $encrypted_data, MCRYPT_DECRYPT); printf ("Decrypt Text: %s Count:%s", $decrypted_data, strlen($decrypted_data)); ?> Output: Input Text: 123456789 Count:9 Decrypt Text: 123456789 Count:16