Crypto Tools

Universal crypto operations: encryption, decryption, hashing, and more

Overview

The node provides universal cryptographic operations including encryption, decryption, hashing, HMAC generation, key derivation, and encoding/decoding in Base64 or Hex formats. Specifically for the Hash operation, it generates a cryptographic hash of the input data using various supported algorithms.

This node is beneficial when you need to securely generate fixed-size digests from arbitrary input data, useful for data integrity verification, fingerprinting, or storing hashed values such as passwords or checksums.

Practical examples:

  • Generating SHA256 hashes of user inputs to verify data integrity.
  • Creating MD5 hashes for quick file fingerprinting.
  • Using BLAKE2b512 for high-performance cryptographic hashing in security-sensitive applications.

Properties

Name Meaning
Hash Algorithm The cryptographic hash algorithm to use. Options: BLAKE2b512, MD5, SHA1, SHA256, SHA3-256, SHA3-512, SHA512
Input Data The string data to be hashed.
Input Format Format of the input data. Options: UTF-8 String, Base64, Hex
Output Format Format of the output hash result. Options: Base64, Hex, UTF-8 String, JSON (auto-parsed if possible)

Output

The output JSON object contains:

  • operation: The performed operation name, here always "hash".
  • result: The resulting hash digest encoded in the selected output format (Base64, Hex, UTF-8 string, or JSON).
  • success: Boolean indicating if the operation succeeded (true).
  • inputLength: Length of the input data string.

Example output JSON:

{
  "operation": "hash",
  "result": "a3f5c8e7d9...",
  "success": true,
  "inputLength": 123
}

No binary output is produced; all results are encoded as strings according to the chosen output format.

Dependencies

  • Uses Node.js built-in crypto module for cryptographic functions.
  • No external API keys or services required.
  • No special environment variables needed.
  • Runs fully within n8n without additional configuration.

Troubleshooting

  • Common issues:

    • Invalid input format specified (not utf8/base64/hex) will cause an error.
    • Unsupported hash algorithm selection will throw an error.
    • If input data is empty or malformed for the chosen input format, hashing may fail.
  • Error messages:

    • "Unknown input format: ..." — Ensure the input format matches the actual data encoding.
    • "Hash failed: ..." — Indicates internal crypto errors, often due to invalid parameters or corrupted input.
    • "Unknown operation: ..." — Should not occur if only "hash" operation is used.
  • Resolution tips:

    • Verify that the input data matches the declared input format.
    • Choose a supported hash algorithm.
    • Use valid UTF-8, Base64, or Hex strings as input.

Links and References

Discussion