php
//加密
function encryption($str,$key = 'gV0iX9aD') {
$iv = $key;
$data = openssl_encrypt($str,"DES-CBC...",$key,OPENSSL_RAW_DATA,$iv);
$data = strtolower(bin2hex($data));
return $data;
}
//解密
function...decryption($str,$key = 'gV0iX9aD') {
$iv = $key;
return openssl_decrypt (hex2bin($str), 'DES-CBC...', $key, OPENSSL_RAW_DATA,$iv);
}
$data = "123456";
$encryption = encryption($data); //加密字符串123456