参数
string
必填
从 Lua string 读取的 plaintext 字节。
string
必填
传递给 AES 前会被解码的 Base64 key。
string
CBC 或 CTR 的可选 Base64 IV。CBC 或 CTR 省略时,会生成新的 AES block size IV。
"CBC" | "ECB" | "CTR" | "AES-CBC" | "AES-ECB" | "AES-CTR"
AES mode。如果存在 AES- prefix,会将其移除。默认值是 AES-CBC。CBC 和 ECB 使用 crypto library DEFAULT_PADDING;CTR 不使用 padding。
返回值
string
Base64-encoded ciphertext。
string | nil
CBC 和 CTR 的 Base64-encoded IV;ECB 为 nil。