Security Filters

Security Filters

decrypt_aes filter

Returns the unencrypted value of the input string using a shared secret and optional salt. If no salt is provided, a default salt value is used.

decrypt_aes: String secretString salt

Examples

Use the encrypt_aes and decrypt_aes filters to encrypt and decrypt strings using the aes alrorithm.

Encrypt and decrypt strings with aes

Copy
{% var secret = "my secret string" %}
{% var salt = "my salt" %}

encrypt_aes

{% var securetext = "I want this to be reasonably secure" | encrypt_aes: secret, salt %}
{{securetext}}

decrypt_aes

{{securetext | decrypt_aes: secret, salt }}

encrypt_aes filter

Returns the encrypted value of the input string using a shared secret and optional salt. If no salt is provided, a default salt value is used.

encrypt_aes: String secretString salt

Examples

Use the encrypt_aes and decrypt_aes filters to encrypt and decrypt strings using the aes alrorithm.

Encrypt and decrypt strings with aes

Copy
{% var secret = "my secret string" %}
{% var salt = "my salt" %}

encrypt_aes

{% var securetext = "I want this to be reasonably secure" | encrypt_aes: secret, salt %}
{{securetext}}

decrypt_aes

{{securetext | decrypt_aes: secret, salt }}

base64_url_safe_encode filter

Encodes a string to a URL-safe base64 format. The difference between the base64 and URL-safe base64 formats is that the URL-safe format uses - and _ in place of + and /, which can cause problems when used in a URL.

base64_url_safe_encode

Examples

Use the base64_encode, base64_decode, base64_url_safe_encode, and base64_url_safe_decode filters to encode and decode strings to and from a base64 format.

Encoding and decoding from base64

Copy

base64_encode

{{ '>>> do you want to stop?' | base64_encode }}

base64_decode

{{ 'Pj4+IGRvIHlvdSB3YW50IHRvIHN0b3A/' | base64_decode }}

base64_url_safe_encode

{{ '>>> do you want to stop?' | base64_url_safe_encode }}

base64_url_safe_decode

{{ 'Pj4-IGRvIHlvdSB3YW50IHRvIHN0b3A_' | base64_url_safe_decode }}

base64_url_safe_decode filter

Decodes a string from a URL-safe base64 format. The difference between the base64 and URL-safe base64 formats is that the URL-safe format uses - and _ in place of + and /, which can cause problems when used in a URL.

base64_url_safe_decode

Examples

Use the base64_encode, base64_decode, base64_url_safe_encode, and base64_url_safe_decode filters to encode and decode strings to and from a base64 format.

Encoding and decoding from base64

Copy

base64_encode

{{ '>>> do you want to stop?' | base64_encode }}

base64_decode

{{ 'Pj4+IGRvIHlvdSB3YW50IHRvIHN0b3A/' | base64_decode }}

base64_url_safe_encode

{{ '>>> do you want to stop?' | base64_url_safe_encode }}

base64_url_safe_decode

{{ 'Pj4-IGRvIHlvdSB3YW50IHRvIHN0b3A_' | base64_url_safe_decode }}

base64_encode filter

Encodes a string to Base64 format

base64_encode

Examples

Use the base64_encode, base64_decode, base64_url_safe_encode, and base64_url_safe_decode filters to encode and decode strings to and from a base64 format.

Encoding and decoding from base64

Copy

base64_encode

{{ '>>> do you want to stop?' | base64_encode }}

base64_decode

{{ 'Pj4+IGRvIHlvdSB3YW50IHRvIHN0b3A/' | base64_decode }}

base64_url_safe_encode

{{ '>>> do you want to stop?' | base64_url_safe_encode }}

base64_url_safe_decode

{{ 'Pj4-IGRvIHlvdSB3YW50IHRvIHN0b3A_' | base64_url_safe_decode }}

base64_decode filter

Decodes a string from Base64 format

base64_decode

Examples

Use the base64_encode, base64_decode, base64_url_safe_encode, and base64_url_safe_decode filters to encode and decode strings to and from a base64 format.

Encoding and decoding from base64

Copy

base64_encode

{{ '>>> do you want to stop?' | base64_encode }}

base64_decode

{{ 'Pj4+IGRvIHlvdSB3YW50IHRvIHN0b3A/' | base64_decode }}

base64_url_safe_encode

{{ '>>> do you want to stop?' | base64_url_safe_encode }}

base64_url_safe_decode

{{ 'Pj4-IGRvIHlvdSB3YW50IHRvIHN0b3A_' | base64_url_safe_decode }}