I have a function in PHP that encrypts text as follows:
function encrypt($text) { $Key = \"MyKey\"; return trim(base64_encode(mcrypt_encrypt(MCRYPT_
If you're willing to use MCRYPT_RIJNDAEL_128 rather than 256 on the PHP side, this is as simple as:
from Crypto.Cipher import AES import base64 key="MyKey" def decrypt(text) cipher=AES.new(key) return cipher.decrypt(base64.b64decode(text))