Use security filters to encrypt and decrypt strings.
Note: Particularly for code that may be re-used across multiple sites, it is recommended to store secrets in a site setting where it can quickly and easily be updated.
Decodes a string in Base64 format.
base64_decode
Encodes a string to Base64 format.
base64_encode
Decodes a string in URL-safe Base64 format.
base64_url_safe_decode
Encodes a string to URL-safe Base64 format. To produce URL-safe Base64, this filter uses - and _ in place of + and /.
base64_url_safe_encode
Returns the unencrypted value of the input using a shared secret and optional salt. If no salt is provided, a default salt value is used.
decrypt_aes: String secret, String salt (optional)
Returns an encrypted value of the input using a shared secret and optional salt. If no salt is provided, a default salt value is used.
encrypt_aes: String secret, String salt (optional)
{% capture salt %}{{ entity.guid }}{{ entity.name.value }}{% endcapture %} {% set salt = salt | url_encode %} {% assign some_secret_string = entity.secret.value | encrypt_aes: site.shared_secret.value, salt %} {% assign some_decoded_string = request.query_params.encrypted_data | decrypt_aes: site.shared_secret.value, salt %}