Description
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
1. In n8n, go to Settings > Community Nodes.
2. Select Install.
3. Enter @luka-cat-mimi/n8n-nodes-bcryptjs in the npm Package Name field.
4. 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’
- Password: The password to hash
- Salt or Rounds: Salt value to use for hashing, or number specifying rounds
- Password: The original password to compare
- Hash: The hash value to compare against the password
- Hash: The hash value to extract rounds from
- Hash: The hash value to extract salt from
- Password: The password to check
- Output Field Name: Field name where the result will be saved, default is ‘result’
#### Hash Password
#### Compare Password
#### Get Rounds
#### Get Salt
#### Test Truncation
Options
Usage Examples
Example 1: Password Hashing
Hash passwords when creating users:
1. Set operation to Hash Password
2. Enter the password to hash
3. Set rounds (recommended 10-12)
4. 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:
1. Set operation to Compare Password
2. Enter the original password and stored hash value
3. 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:
1. Expand the Options section
2. Set Output Field Name to hashedPassword
3. The result will be saved to the specified field
Output:
{
"password": "mySecretPassword",
"hashedPassword": "$2b$10$N9qo8uLOickgx2ZMRZoMye..."
}
Security Considerations
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-bcryptjsInstall dependencies
npm installBuild the project
npm run buildRun code quality checks
npm run lintFix code formatting
npm run lintfix
Resources
License
MIT © luka-cat-mimi
—
If this project helps you, please give it a ⭐️!
Issue Reports: GitHub Issues