BlocksTokens & Crypto
Decrypt String
Unlock encrypted data using a secret key.
The Decrypt String block reverses the encryption process, turning a scrambled string back into its original, readable text. You must use the exact same Secret and Algorithm that were used to encrypt the data.
Configuration
| Field | Required | Description |
|---|---|---|
| Secret | ✅ | The project secret used during encryption. |
| Input encrypted String | ✅ | The scrambled text you want to unlock. |
| Decryption Algorithm | ✅ | Must match the algorithm used for encryption (AES-256 or AES-128). |
| Decoding Type | ✅ | How to interpret the input and output: hex, base64, or automatic. |
| Decrypted Variable | ✅ | The name of the variable that will store the original text. |
Automatic Decoding
The automatic setting attempts to detect if your input is formatted in hex or base64 and returns the final result as a standard text string.
Error Handling
SECRET_MISSING— Triggered when no secret is provided.FIELD_MISSING— Triggered if input, algorithm, or decoding fields are empty.SECRET_RETRIEVE_ERROR— Triggered if the selected secret cannot be loaded.DECRYPTION_INVALID_KEY_LENGTH— Triggered if the secret length doesn't match the algorithm requirement.DECRYPTION_INVALID_ALGORITHM— Triggered if the specified algorithm is not supported.DECRYPTION_INVALID_INPUT— Triggered if the input data is too short or malformed.DECRYPTION_BAD_DECRYPT— Triggered if the secret is wrong or the data is corrupted.DECRYPTION_FAILED— General failure during decryption.
Example: Retrieving a Saved API Key
- Secret: Select the
STORAGE_ENCRYPTION_KEYused previously. - Input encrypted String: Set to
{db.users.encrypted_key}. - Decryption Algorithm: Select
AES-256. - Decoding Type: Select
automatic. - Decrypted Variable: Enter
plain_api_key. - Result: The variable
{plain_api_key}now contains the original readable key, which you can use in an External API Request block.
