TLingC's Zone
TLingC's Zone


文章归档

php实现aes-128-ecb SHA1PRNG 加解密

在PHP中实现Java下使用SecureRandom SHA1PRNG算法进行AES-128-ECB(AES/ECB/PKCS5Padding)加解密的效果: function encrypt($data, $password) { $key = substr(openssl_digest(openssl_digest($password, 'sha1', true), 'sha1', true), 0, 16); $result = openssl_encrypt($data, 'AES-128-ECB', $key); return $result; } function decrypt($data, $password) { $key = substr(openssl_digest(openssl_digest($password, 'sha1', true), 'sha1', true), 0, 16)…

74   2021-06-18