Link to home
Start Free TrialLog in
Avatar of Maranellas
Maranellas

asked on

3des decryptor on PHP

Can some one tell me how can i make Triple Des Decryptor script?
ASKER CERTIFIED SOLUTION
Avatar of Chad Smith
Chad Smith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Maranellas
Maranellas

ASKER

Fatal error: Call to undefined function mcrypt_get_iv_size() in C:\WINDOWS\AppPatch\AppServ\www\3des.php on line 3
first problem solved

but i get another problem

Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: Size of key is too large for this algorithm in /home/tuapuest/public_html/tmp/3des.php on line 6

the actual string is "6561535437506C766655576B6938734A4A68587448413D3D"

which corresponds to 192 bit string
<?
$key = $_GET['key'];
$iv_size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
                  
$decoded = trim(mcrypt_decrypt(MCRYPT_3DES, $key, $encodedstring, MCRYPT_MODE_ECB, $iv)); 
?>

Open in new window