PHP內建的加密function
<?php
$key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; //加密key
$data = "1111111111111111"; //待加密資料
$iv = pack("h16","1111111111111111"); //iv
$KeyValue = pack("H*", $key.substr($key, 0, 16)); //或 $KeyValue = pack("H*", $key);
$result = mcrypt_cbc(MCRYPT_TRIPLEDES, $keyValue, $data, MCRYPT_ENCRYPT, $iv);
die(bin2hex($result));
?>
<?php
$key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; //加密key
$data = "1111111111111111"; //待加密資料
$iv = pack("h16","1111111111111111"); //iv
$KeyValue = pack("H*", $key.substr($key, 0, 16)); //或 $KeyValue = pack("H*", $key);
$result = mcrypt_cbc(MCRYPT_TRIPLEDES, $keyValue, $data, MCRYPT_ENCRYPT, $iv);
die(bin2hex($result));
?>
全站熱搜
留言列表