Install
openclaw skills install bcrypt-generateHash passwords using bcrypt or verify a password against a bcrypt hash. Use when the user asks to bcrypt a password, generate a bcrypt hash, check if a password matches a hash, or store a password securely.
openclaw skills install bcrypt-generateHash passwords with bcrypt or verify existing hashes using Python's bcrypt library.
For hashing:
For verification:
$2b$ or $2a$)Determine mode: hash a new password, or verify against an existing hash.
Hashing a password:
python3 -c "import bcrypt; print(bcrypt.hashpw(b'PASSWORD', bcrypt.gensalt(rounds=ROUNDS)).decode())"
Replace PASSWORD with the actual password and ROUNDS with the cost factor (default 10).
Verifying a password against a hash:
python3 -c "import bcrypt; print(bcrypt.checkpw(b'PASSWORD', b'HASH'))"
Replace PASSWORD and HASH with the actual values.
Check if bcrypt Python package is available before running:
python3 -c "import bcrypt" 2>&1
If it fails with ModuleNotFoundError, tell the user:
"This skill requires the Python
bcryptpackage. Install with:pip3 install bcrypt."
If python3 is not found at all, tell the user:
"This skill requires
python3. Install with:brew install python3(macOS) orsudo apt install python3(Linux)."
Present the hash output on its own line. For verification, report clearly: "Password MATCHES the hash" or "Password does NOT match the hash."
Hash password "mysecret" with cost 10:
Command: python3 -c "import bcrypt; print(bcrypt.hashpw(b'mysecret', bcrypt.gensalt(rounds=10)).decode())"
Output: $2b$10$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW
Hash password "admin" with cost 12:
Command: python3 -c "import bcrypt; print(bcrypt.hashpw(b'admin', bcrypt.gensalt(rounds=12)).decode())"
Output: $2b$12$... (60-char bcrypt hash)
Verify "mysecret" against $2b$10$abc...:
Command: python3 -c "import bcrypt; print(bcrypt.checkpw(b'mysecret', b'\$2b\$10\$abc...'))"
Output: True
python3 not found → tell user to install Python 3bcrypt module not found → tell user to run pip3 install bcrypt$2b$ or $2a$) → warn the user the hash appears invalid before running