BcryptSalted icon

BcryptSalted

Generate a salted bcrypt hash from input string

Overview

This node generates a salted bcrypt hash from an input string. It is useful for securely hashing passwords or any sensitive text data before storing or transmitting it, ensuring that the original input cannot be easily retrieved or compromised. Typical use cases include password hashing for user authentication systems, generating secure tokens, or protecting sensitive information in workflows.

For example, you can input a user's plaintext password and specify the number of salt rounds to produce a strong bcrypt hash that can be stored safely in a database.

Properties

Name Meaning
Input String The string value that you want to hash using bcrypt.
Salt Rounds Number of salt rounds to apply during bcrypt hashing. Higher values increase security but also processing time. Allowed range: 1 to 20.

Output

The node outputs an array of JSON objects, each containing:

  • input: The original input string provided.
  • hash: The resulting bcrypt salted hash string generated from the input.

No binary data output is produced by this node.

Example output JSON:

{
  "input": "myPassword123",
  "hash": "$2b$10$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36Q6f0v5xq7r8u9v0y1z2a"
}

Dependencies

  • This node relies on a cryptographic library capable of generating bcrypt hashes.
  • No external API keys or services are required.
  • It uses internal cryptographic functions and random byte generation available in the runtime environment.

Troubleshooting

  • Common issues:

    • Providing an empty or non-string input for the string to hash will cause errors.
    • Specifying salt rounds outside the allowed range (1-20) may result in errors or unexpected behavior.
    • Insufficient runtime support for cryptographic functions could cause failures.
  • Error messages:

    • "Illegal arguments": Indicates invalid types or values for input string or salt rounds.
    • "Neither WebCryptoAPI nor a crypto module is available": Means the environment lacks necessary cryptographic support.
    • To resolve these, ensure valid inputs and run the node in an environment with proper crypto support.

Links and References

Discussion