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. Specifically, the "Hex Decode" operation decodes input data from hexadecimal format into a UTF-8 string.

This node is useful in scenarios where you need to convert hex-encoded data back into readable text or further process it in workflows. For example, if you receive data from an external system encoded as hex, you can use this node to decode it before parsing or storing it.

Practical example:

  • Decoding a hex-encoded message received from an IoT device to extract sensor readings.
  • Converting hex-encoded cryptographic keys or hashes back to their original string form for validation or display.

Properties

Name Meaning
Input Data The hex-encoded string to decode

Output

The output JSON contains the following fields:

  • operation: The name of the performed operation, here always "hexDecode".
  • result: The decoded UTF-8 string obtained by converting the input hex data.
  • success: A boolean indicating whether the operation succeeded (true) or failed (false).
  • inputLength: The length of the input hex string.

Example output JSON:

{
  "operation": "hexDecode",
  "result": "decoded string here",
  "success": true,
  "inputLength": 42
}

No binary data output is produced by this operation; the result is always a UTF-8 string decoded from hex.

Dependencies

  • Uses Node.js built-in crypto module for cryptographic functions.
  • No external API keys or services are required for the "Hex Decode" operation.
  • Requires n8n environment with standard node execution capabilities.

Troubleshooting

  • Invalid hex input: If the input string is not valid hex, the node will throw an error during decoding. Ensure the input data contains only valid hexadecimal characters (0-9, a-f, A-F) and has an even length.
  • Empty input: Providing empty input will result in an empty output string without error.
  • Unexpected errors: Any unexpected error will be reported with a message indicating failure in decoding.

To resolve issues:

  • Validate input data format before passing to the node.
  • Use error handling in your workflow to catch and manage failures gracefully.

Links and References

Discussion