Crypto Tools

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

Overview

The node "Crypto Tools" provides a variety of cryptographic operations including encoding, decoding, encryption, decryption, hashing, HMAC generation, and key derivation. It is designed as a universal tool for handling common cryptographic tasks within n8n workflows.

For the Hex Encode operation specifically, the node converts input data (a UTF-8 string) into its hexadecimal representation. This is useful when you need to represent binary or textual data in a compact hex format, for example:

  • Preparing data for systems that require hex-encoded inputs.
  • Debugging or logging raw data in a readable hex form.
  • Encoding data before transmission over protocols that expect hex strings.

Properties

Name Meaning
Input Data The UTF-8 string data to encode

Output

The output JSON object contains the following fields:

  • operation: The name of the performed operation, here it will be "hexEncode".
  • result: The resulting hex-encoded string of the input data.
  • success: A boolean indicating if the operation was successful (true).
  • inputLength: The length of the original input string.

Example output JSON:

{
  "operation": "hexEncode",
  "result": "68656c6c6f",  // hex representation of "hello"
  "success": true,
  "inputLength": 5
}

No binary data output is produced by this operation.

Dependencies

  • Uses Node.js built-in crypto module for cryptographic functions.
  • No external API keys or credentials are required for the Hex Encode operation.
  • No special environment variables or n8n configurations needed.

Troubleshooting

  • Common issues:
    • Input data must be a valid UTF-8 string; otherwise, unexpected results may occur.
  • Error messages:
    • If an unknown operation is specified, the node throws an error like Unknown operation: <operation>.
    • For Hex Encode, errors are unlikely unless the input data is invalid or missing.
  • To resolve errors, ensure the "Input Data" property is correctly set and the operation is selected as "Hex Encode".

Links and References

Discussion