Overview
This node performs AES (Advanced Encryption Standard) encryption and decryption on input text data. It supports multiple cipher modes and padding schemes, allowing users to customize the cryptographic process according to their security requirements.
Common scenarios for this node include:
- Encrypting sensitive information before storing or transmitting it.
- Decrypting previously encrypted data to retrieve the original content.
- Integrating with systems that require AES-encrypted payloads in specific modes and paddings.
Practical example:
- Encrypt a password or API key using AES-CBC mode with PKCS7 padding and Base64 encoding before saving it to a database.
- Decrypt an incoming encrypted message from another system that uses AES-CTR mode with ZeroPadding and Hex encoding.
Properties
| Name | Meaning |
|---|---|
| Mode | The AES cipher mode to use. Options: CBC, CFB, CTR, ECB, OFB |
| Padding | The padding scheme applied during encryption/decryption. Options: AnsiX923, Iso10126, Iso97971, NoPadding, Pkcs7, ZeroPadding |
| Encoding | The output/input encoding format. Options: Base64, Hex |
| Type | The type of input data. Currently only "String" is supported |
| Text | The actual text string to encrypt or decrypt |
Output
The node outputs JSON objects containing either an encrypted or decrypted field depending on the operation:
For Encrypt operation:
{ "encrypted": "<encrypted_string>" }where
<encrypted_string>is the AES-encrypted text encoded in the selected encoding (Base64 or Hex).For Decrypt operation:
{ "decrypted": "<decrypted_string>" }where
<decrypted_string>is the original plaintext after AES decryption.
No binary data output is produced by this node; all data is handled as strings.
Dependencies
- Requires an external AES key credential containing a key string at least 32 characters long.
- Uses the
crypto-jslibrary internally for AES operations. - No additional environment variables are needed beyond providing the AES key credential.
Troubleshooting
Common issues:
- Using an AES key shorter than 32 characters will cause errors because the key is sliced into two 16-byte parts.
- Providing incorrectly encoded input text (e.g., not matching the specified encoding) can lead to decryption failures or empty results.
- Selecting incompatible combinations of mode and padding may cause unexpected errors.
Error messages:
- Errors thrown during encryption/decryption typically contain the underlying crypto-js error message.
- If the node fails and "Continue On Fail" is disabled, execution stops immediately.
- To handle errors gracefully, enable "Continue On Fail" to receive error details per item in the output.
Resolution tips:
- Ensure the AES key is correctly configured and meets length requirements.
- Verify the input text matches the expected encoding format.
- Test different mode and padding combinations if encountering errors.