PHP代码:
$key = "12345678abcdefgh12345678abcdefgh";
$iv = "12345678abcdefgh";
$plaindata = "This is a test string.";
$enc = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaindata, MCRYPT_MODE_CBC, $iv));
echo($enc);
结果:
QBN0Yue3D9hBrBuD01n5KWG+lv2doMf97cKm/AeusAI=
如何在 Python 中解密?