bcrypt

bcrypt password hashing. Use for password security.

7 stars

Best use case

bcrypt is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

bcrypt password hashing. Use for password security.

Teams using bcrypt should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/bcrypt/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/security/bcrypt/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bcrypt/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How bcrypt Compares

Feature / AgentbcryptStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

bcrypt password hashing. Use for password security.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Bcrypt

Bcrypt is a password-hashing function designed to be slow, protecting against brute-force attacks. It incorporates a salt to protect against rainbow table attacks.

## When to Use

- **User Passwords**: Storing passwords in a database. NEVER store them in plain text.
- **API Keys**: Hashing API keys before storage (if you only show them once).

## Quick Start (Node.js)

```javascript
import bcrypt from "bcrypt";

const saltRounds = 10;
const myPlaintextPassword = "s0m3password";

// Hashing
const hash = await bcrypt.hash(myPlaintextPassword, saltRounds);
// Store 'hash' in DB: $2b$10$EpIxT98h....

// Verifying
const match = await bcrypt.compare("s0m3password", hash);
if (match) {
  // Login successful
}
```

## Core Concepts

### Salt

Random data added to the password input before hashing. Ensures that two users with the same password have different hashes. Bcrypt handles this automatically.

### Work Factor (Cost)

The `saltRounds` (e.g., 10 or 12). Determines how slow the hashing is. As computers get faster, you increase the cost to keep brute-forcing expensive.

## Best Practices (2025)

**Do**:

- **Use Cost 10-12**: A good balance between security (slow for attackers) and UX (fast enough for login).
- **Consider Argon2id**: For new high-security projects, **Argon2id** is the modern winner (OWASP recommendation) as it resists GPU cracking better than Bcrypt. But Bcrypt is still "secure enough" for most web apps.
- **Async**: Always use the async version to avoid blocking the Event Loop in Node.js.

**Don't**:

- **Don't Roll Your Own Crypto**: Never use SHA-256 or MD5 for passwords.
- **Don't pre-hash**: Don't MD5 the password on the client before sending it. Send via HTTPS, then Bcrypt on server.

## References

- [OWASP Password Storage Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html)