<?php
$_url_safe_characters = array (
'-',
'_',
'',
);
$_not_url_safe_characters = array (
'+',
'/',
'=',
);
/* Data */
$key = 'this is a very long key, even too long for the cipher';
$encrypted_price = '-cMgOXQks';
$key = '123456789012345678901234';
$str_iv = 'genieeee';
$encrypted_price = str_replace ( $_url_safe_characters, $_not_url_safe_characters, $encrypted_price );
echo 'encrypted_price = '. $encrypted_price, ',';
$encrypted_price = base64_decode ( $encrypted_price );
echo 'decodebase64 = '. $encrypted_price, ',';
/* Open module, and create IV */
$td = mcrypt_module_open('des', '', 'cfb', '');
/* Initialize encryption handle */
if (mcrypt_generic_init($td, $key, $str_iv) != -1) {
/* Encrypt data */
$decrypted_price = mdecrypt_generic($td, $encrypted_price);
/* Clean up */
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
}
echo 'decrypted_price = '. floatval($decrypted_price);
?>
preferences:
117.96 ms | 405 KiB | 5 Q