Aliases

None.

Arguments

string
required
The input bytes as a binary-safe Luau string.
string
required
A Base64-encoded key that decodes to exactly 32 bytes.
string
default:"nil"
Optional Base64 IV. Omit it to generate one; a supplied IV must decode to at least 16 bytes.
string
default:"\"CBC\""
The encryption mode; this implementation supports CBC only.

Returns

string
The Base64-encoded AES-256-CBC ciphertext.
string
The Base64 IV to preserve for decryption.
Only CBC, case-insensitive. Key must decode to 32 bytes. Omitted IV generates 16 bytes; supplied IV must decode to at least 16 bytes (first 16 used). CBC does not authenticate ciphertext; define integrity separately when needed.

Example