Decrypt
Schema
decrypt:
- algorithm: <ident>
- encryption_key: <string>
- field: <ident>
- iv_field: <ident>
- description: <text>
- if: <script>
- ignore_failure: <boolean>
- ignore_missing: <boolean>
- on_failure: <processor[]>
- on_success: <processor[]>
- tag: <string>
- with_compression: <boolean>
Synopsis
Decrypts encrypted string values using AES encryption with a specified key and initialization vector.
Configuration
Field | Required | Default | Description |
---|---|---|---|
algorithm | Y | - | Encryption algorithm to use. Valid values: AES-256-GCM or AES-256-CFB |
encryption_key | Y | - | 32-byte key used for decryption |
field | Y | - | Field containing the encrypted value to be decrypted |
iv_field | Y | - | Field containing the initialization vector |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | See Handling Failures |
ignore_missing | N | false | If true and field does not exist or is null , exit quietly without making any modifications |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
with_compression | N | false | Enable compression during decryption |
Details
The processor supports both AES-256-GCM (Galois/Counter Mode) and AES-256-CFB (Cipher Feedback) modes:
-
AES-256-GCM (Galois/Counter Mode) - Provides both confidentiality and authenticity. This is more secure against tampering, although slightly slower than the CFB mode.
-
AES-256-CFB (Cipher Feedback) - Provides confidentiality. This is faster than the GCM mode, although there is no built-in authentication.
The encryption key must be exactly 32 bytes long for the AES-256 encryption, and both the encrypted value and IV must be base64 encoded strings.
Unsupported algorithms will result in error.
To improve performance, the processor automatically caches cipher instances for repeated use with the same encryption key.
Examples
AES-256-CFB
When decrypting in the CFB mode... |
|
the decrypted value is stored in place: |
|
AES-256-GCM with Compression
Using the GCM mode with compression... |
|
decompresses the values after decryption: |
|
Error Handling
If an invalid key length is specified... |
|
the raised error is captured: |
|