Package Information
Documentation
n8n-nodes-bcryptjs

This is an n8n community node that allows you to use bcryptjs for password hashing and verification operations in your n8n workflows.
n8n is a fair-code licensed workflow automation platform.
Installation • Operations • Usage Examples • Resources
Installation
Follow the installation guide in the n8n community nodes documentation.
Community Nodes Installation
- In n8n, go to Settings > Community Nodes.
- Select Install.
- Enter
@luka-cat-mimi/n8n-nodes-bcryptjsin the npm Package Name field. - Agree to the risks, then select Install.
After installation, the Bcryptjs node will appear in the Cryptography category.
Manual Installation
To install the node locally, you can use npm package manager:
# For n8n self-hosted
npm install @luka-cat-mimi/n8n-nodes-bcryptjs
Operations
This node provides all bcryptjs async function capabilities:
Supported Operations
| Operation | Description |
|---|---|
| Compare Password | Asynchronously compare password with hash |
| Generate Salt | Asynchronously generate salt value |
| Get Rounds | Get the number of rounds used in the hash |
| Get Salt | Extract salt portion from hash |
| Hash Password | Asynchronously hash password |
| Test Truncation | Test if password will be truncated (over 72 bytes) |
Parameter Descriptions
Generate Salt
- Rounds: The cost of processing the data, default value is 10
- Minor Version: The minor version of bcrypt, 'a' or 'b', default is 'b'
Hash Password
- Password: The password to hash
- Salt or Rounds: Salt value to use for hashing, or number specifying rounds
Compare Password
- Password: The original password to compare
- Hash: The hash value to compare against the password
Get Rounds
- Hash: The hash value to extract rounds from
Get Salt
- Hash: The hash value to extract salt from
Test Truncation
- Password: The password to check
Options
- Output Field Name: Field name where the result will be saved, default is 'result'
Usage Examples
Example 1: Password Hashing
Hash passwords when creating users:
- Set operation to Hash Password
- Enter the password to hash
- Set rounds (recommended 10-12)
- The node will return the hashed password
Input:
{
"password": "mySecretPassword"
}
Output:
{
"password": "mySecretPassword",
"result": "$2b$10$N9qo8uLOickgx2ZMRZoMye..."
}
Example 2: Password Verification
Verify passwords during user login:
- Set operation to Compare Password
- Enter the original password and stored hash value
- The node will return true or false
Input:
{
"password": "mySecretPassword",
"hash": "$2b$10$N9qo8uLOickgx2ZMRZoMye..."
}
Output:
{
"password": "mySecretPassword",
"hash": "$2b$10$N9qo8uLOickgx2ZMRZoMye...",
"result": true
}
Example 3: Custom Output Field
Set a custom output field name in options:
- Expand the Options section
- Set Output Field Name to
hashedPassword - The result will be saved to the specified field
Output:
{
"password": "mySecretPassword",
"hashedPassword": "$2b$10$N9qo8uLOickgx2ZMRZoMye..."
}
Security Considerations
- bcrypt only uses the first 72 bytes of a password, any extra bytes are ignored
- Recommend using async version to avoid blocking the event loop
- Higher rounds mean better security but longer processing time
- Default rounds of 10 is secure for most cases
- Production environments should consider using 12 rounds or higher
Development
To develop or contribute to this project:
# Clone the repository
git clone https://github.com/luka-mimi/n8n-nodes-bcryptjs.git
cd n8n-nodes-bcryptjs
# Install dependencies
npm install
# Build the project
npm run build
# Run code quality checks
npm run lint
# Fix code formatting
npm run lintfix
Resources
- n8n community nodes documentation
- bcryptjs documentation - The underlying crypto library
- bcrypt algorithm explanation - Learn about the bcrypt algorithm
License
MIT © luka-cat-mimi
If this project helps you, please give it a ⭐️!
Issue Reports: GitHub Issues
中文文档: README_CN.md