Overview
The node provides universal cryptographic operations including encryption, decryption, hashing, HMAC generation, key derivation, and encoding/decoding in Base64 or Hex formats. It supports multiple algorithms such as AES (various key sizes and modes), ChaCha20-Poly1305, and DES-EDE3-CBC.
This node is beneficial when you need to securely encrypt sensitive data before storage or transmission, decrypt received encrypted data, generate hashes for integrity checks, create HMAC signatures for authentication, or derive cryptographic keys from passwords. For example, you can encrypt user credentials with AES-256-CBC before saving them, or generate a SHA256 hash of a file content to verify its integrity.
Properties
| Name | Meaning |
|---|---|
| Algorithm | The cryptographic algorithm used for encryption or decryption. Options: AES-128-CBC, AES-192-CBC, AES-256-CBC, AES-256-GCM, ChaCha20-Poly1305, DES-EDE3-CBC. |
| Key | The secret key or password used for encryption, decryption, or HMAC generation. This is a required field and treated as sensitive input. |
| Input Data | The data string to be processed by the selected operation (e.g., text to encrypt or decrypt). |
| Key Processing | How to process the key before use. Options: Use as-Is (raw), SHA256 Hash, PBKDF2 Derive. |
| Initialization Vector (IV) | Custom initialization vector in hexadecimal format for encryption algorithms that require it (CBC modes and DES). If left empty, a random IV will be generated automatically. |
| Output Format | Format of the output result. Options: Base64, Hex, UTF-8 String, JSON (auto-parsed for decryption). |
| Input Format | Format of the input data. Options: UTF-8 String, Base64, Hex. Used for encryption, decryption, hash, and HMAC operations. |
Output
The node outputs a JSON object with the following fields:
operation: The name of the performed operation (e.g., "encrypt").result: The resulting data after the operation, formatted according to the selected output format.success: Boolean indicating if the operation was successful.inputLength: Length of the input data string.
If an error occurs and "Continue On Fail" is enabled, the output contains:
error: Error message describing what went wrong.success: false
The node does not output binary data directly; all results are encoded as strings in the chosen output format.
Dependencies
- Uses Node.js built-in
cryptomodule for all cryptographic functions. - No external API or service dependencies.
- Requires no special environment variables but needs proper configuration of input parameters like keys and IVs.
Troubleshooting
Common Issues:
- Providing an invalid or incorrectly formatted key or IV (e.g., non-hex string for IV) may cause errors.
- Using an unsupported algorithm or operation will throw an error.
- Decryption failures often occur if the input data is corrupted or the wrong key/IV is used.
- Incorrect input or output format settings can lead to unexpected results or parsing errors.
Error Messages:
"Encryption failed: ..."indicates issues during encryption, possibly due to invalid key or IV."Decryption failed: ..."usually means the ciphertext or key is incorrect or corrupted."Unknown operation: ..."means the specified operation is not supported."Unknown key processing method: ..."or"Unknown input format: ..."indicate misconfiguration of parameters.
Resolution Tips:
- Ensure keys and IVs are correctly formatted and match the algorithm requirements.
- Verify input data encoding matches the selected input format.
- Use the default IV generation unless a specific IV is required.
- Check that the correct operation is selected for your use case.