crypto.encrypt_base64

STRINGcrypto.encrypt_base64IDcipherIDmodeIDpaddingSTRINGkey_hexSTRINGiv_hexSTRINGplaintext_base64

Available in all subroutines.

Equivalent to crypto.encrypt_hex but with the plaintext encoded in Base64. The ciphertext returned is also encoded in Base64.

Base64 decoding behaves as if by a call to digest.base64_decode. See that function for handling invalid characters and the behavior of padding. Unlike digest.base64_decode, the decoded output is used directly (rather than constructing a VCL STRING type), and so binary content is permitted, including possible NUL bytes.

Base64 encoding behaves as if by a call to digest.base64.

Note that the key and Initialization Vector (IV) are encoded as hex strings.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.