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 your secrets in a site setting where it can quickly and easily be updated.
{% var some_secret_string = entity.secret.value | encrypt_aes: site.shared_secret.value %} {% var shouldEqualOriginalValue = some_secret_string | decrypt_aes: site.shared_secret.value %}
{% 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 %}