---
title: "decrypt - Liquid Filter Reference"
source: https://support.storeconnect.com/articles/decrypt-filter-reference
type: article
format: markdown
site: StoreConnect Support — product and developer documentation for StoreConnect
site_index: https://storeconnect.com/llms.txt
docs_index: https://support.storeconnect.com/llms.txt
note: Append .md to any page or article URL on this site to get its Markdown form.
---
# decrypt - Liquid Filter Reference

## Description

Decrypts a value that was previously encrypted using the [encrypt](encrypt-filter-reference) filter. The `salt` option, if used during encryption, must be provided here with the same value. Errors are logged to the Web Console rather than surfaced to the storefront.

| Property | Value |
|----------|-------|
| **Return Type** | string, integer, float, boolean, array, or hash (matches original input type) |
| **Error return** | `nil` (not an empty string) |
| **Category** | text |

## Options

| Option | Description |
|--------|-------------|
| `salt` | An optional salt string used as part of the decryption key. Must match the `salt` used when the value was encrypted. **If omitted, the current session ID is used — the value must have been encrypted in the same session.** |

## Examples

**Decrypt a previously encrypted value:**


```liquid

{{ encrypted_value | decrypt: salt: "my-secret-salt" }}
```


**Round-trip example — encrypt then decrypt:**


```liquid

{% assign encrypted = "hello world" | encrypt: salt: "my-salt" %}
{% assign decrypted = encrypted | decrypt: salt: "my-salt" %}
{{ decrypted }}
```


**Output:** `hello world`

**Decrypt an encrypted array:**


```liquid

{% assign original = "one,two,three" | split: "," %}
{% assign encrypted = original | encrypt: salt: "list-salt" %}
{% assign decrypted = encrypted | decrypt: salt: "list-salt" %}
{% for item in decrypted %}{{ item }}{% endfor %}
```


## Error handling

If decryption fails, the error is written to the Web Console and `nil` is returned. The specific error and message depends on the cause:

| Cause | Console message |
|-------|----------------|
| No encryption salt configured | `No encryption salt found. Cannot encrypt or decrypt data.` |
| Token structure is invalid | `Decrypted token is not valid` |
| Token contains an unsupported type | `Decrypted token has unsupported type {type}` |
| Wrong salt or corrupted token | Returns `nil` silently (no console message) |

Check the Web Console and verify the `salt` value matches what was used during encryption.

---

## Follow StoreConnect

- [Email Newsletter](https://storeconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://storeconnect.com/partners)
- [Become a Partner](https://storeconnect.com/become-a-partner)
- [News](https://storeconnect.com/articles/news)
- [Events](https://storeconnect.com/articles/events)
- [Live Events](https://storeconnect.com/live-events)
- [Feature Comparison](https://storeconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://storeconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

## Machine-readable

- [Site index for agents](https://storeconnect.com/llms.txt): curated map of the StoreConnect site in llms.txt format
- [Documentation index for agents](https://support.storeconnect.com/llms.txt): full technical and product documentation map

Every page and article on this site has a Markdown rendering: append `.md` to its URL.

Continue in Markdown: [Help documentation](https://support.storeconnect.com/help-documentation.md) · [Developer reference](https://support.storeconnect.com/developer-reference.md) · [Videos & tutorials](https://support.storeconnect.com/videos-tutorials.md) · [Release notes](https://support.storeconnect.com/release-notes.md)

---

StoreConnect Support — https://support.storeconnect.com/articles/decrypt-filter-reference