djankies/claude-configs/hashing-passwords
Claude Code and agent skill by djankies/claude-configs
- community
Checking that the SKILL.md file is still in the repository.
CRITICAL security skill teaching proper credential and password handling. NEVER store passwords, use bcrypt/argon2, NEVER accept third-party credentials. Use when handling authentication, passwords, API keys, or any sensitive credentials.
Install
npx vskill@latest install djankies/claude-configs/hashing-passwordsSKILL.md
The same SKILL.md was published earlier as djankies/claude-configs/hashing-passwords.
<role> This skill prevents CRITICAL security failures found in stress testing where 33% of agents had severe security vulnerabilities including Base64 "encryption" for passwords and accepting PayPal passwords directly.
THIS IS A ZERO-TOLERANCE SECURITY SKILL. NO EXCEPTIONS. </role>
<when-to-activate> This skill activates when:
- Working with passwords or authentication
- Handling API keys, tokens, or credentials
- Storing sensitive user data
- Implementing login, signup, or password reset
- User mentions passwords, credentials, encryption, hashing, or authentication
- Code contains password storage, credential handling, or third-party auth
</when-to-activate>
<overview>
Critical Security Rules
RULE 1: NEVER STORE PASSWORDS
Store password HASHES only, using bcrypt or argon2. Passwords must be:
- Hashed (NOT encrypted, NOT Base64, NOT plaintext)
- Salted automatically by bcrypt/argon2
- Using modern algorithms (bcrypt cost 12+, argon2id)
RULE 2: NEVER ACCEPT THIRD-PARTY CREDENTIALS
NEVER ask users for passwords to other services (PayPal, Google, etc.):
- Use OAuth instead
- Use API keys from the service
- Use service-provided SDKs
RULE 3: NEVER USE ENCODING AS ENCRYPTION
- Base64 is NOT encryption (trivially reversible)
- URL encoding is NOT security
- Hex encoding is NOT security
RULE 4: USE PROPER CRYPTOGRAPHY
- For passwords: bcrypt or argon2
- For encryption: Use established libraries (crypto module, Web Crypto API)
- For API keys: Store in environment variables, use secret management
</overview>
<critical-anti-patterns>
NEVER DO THIS
❌ Base64 "Encryption": Buffer.from(password).toString("base64") is encoding, NOT encryption. Trivially reversible.
❌ Third-Party Passwords: Never accept PayPal/Google/etc passwords. Use OAuth.
❌ Plaintext Storage: Never store raw passwords. Always hash.
❌ Weak Hashing: MD5/SHA-1/SHA-256 too fast. Use bcrypt/argon2.
See references/never-do-this.md for detailed examples and failures. </critical-anti-patterns>
<correct-patterns>
✅ CORRECT: bcrypt Password Hashing
Key Points:
- bcrypt designed for passwords
- Automatic salting
- Cost factor 12+ (prevents brute force)
- Never stores actual password
✅ CORRECT: argon2 (More Modern)
Advantages: Memory-hard, resists GPU attacks, latest standard.
✅ CORRECT: OAuth for Third-Party Services
Key Points: Token-based, never sees user password, revocable.
✅ CORRECT: Environment Variables for API Keys
See references/correct-implementations.md for complete examples. </correct-patterns>
<constraints> MUST:
- Use bcrypt (cost 12+) or argon2id for password hashing
- Store password HASHES only, never passwords
- Use OAuth for third-party service authentication
- Store API keys in environment variables
- Validate password strength (min length, complexity)
- Use HTTPS for all authentication endpoints
NEVER:
- Store passwords in any form (plaintext, Base64, encrypted)
- Use MD5, SHA-1, or SHA-256 for passwords
- Accept third-party credentials (PayPal, Google, etc.)
- Hardcode API keys or secrets
- Use encoding (Base64, hex) as "encryption"
- Email passwords to users
- Log passwords (even in dev mode)
SHOULD:
- Implement password strength requirements
- Rate-limit login attempts
- Use two-factor authentication (2FA)
- Implement account lockout after failed attempts
- Rotate API keys periodically
- Use secret management services (AWS Secrets Manager, HashiCorp Vault)
</constraints>
<password-requirements>
Minimum Requirements
- Length: 12+ characters (prefer 16+)
- Complexity: Uppercase, lowercase, numbers, special chars
- Validation: Reject common passwords ("password", "12345678")
See references/password-validation.md for complete implementation. </password-requirements>
<installation>
Installing Password Libraries
bcrypt:
argon2:
Note: Both require native compilation. Ensure build tools are available. </installation>
<progressive-disclosure>
Reference Files
Detailed Examples:
references/never-do-this.md- Security failures and anti-patternsreferences/correct-implementations.md- Complete working examplesreferences/password-validation.md- Password strength validationreferences/emergency-response.md- Breach response and migration
Related Skills:
- Input Validation: Use the sanitizing-user-inputs skill
- Dependencies: Use the auditing-dependencies skill
- External Data: Use the validating-external-data skill
</progressive-disclosure>
<validation>
Security Implementation Checklist
- Password Storage:
- [ ] Uses bcrypt (cost 12+) or argon2id
- [ ] NEVER stores actual passwords
- [ ] Password hashes stored in separate column
- [ ] No way to retrieve original password
- Third-Party Auth:
- [ ] Uses OAuth/OpenID Connect
- [ ] NEVER asks for third-party passwords
- [ ] Tokens stored securely
- [ ] Follows service Terms of Service
- API Keys:
- [ ] Stored in environment variables
- [ ] Not hardcoded in source
- [ ] Not committed to git
- [ ]
.envfile in.gitignore
- Password Requirements:
- [ ] Minimum 12 characters (prefer 16+)
- [ ] Complexity requirements enforced
- [ ] Common passwords rejected
- [ ] Strength meter for users
- Additional Security:
- [ ] HTTPS required for auth endpoints
- [ ] Rate limiting on login
- [ ] Account lockout after failures
- [ ] Password reset via email only
- [ ] No password hints or security questions
</validation>
<common-mistakes>
Why Developers Make These Mistakes
"I need to retrieve the password later" → You never need to retrieve passwords. Use password reset instead.
"Base64 is encryption" → Base64 is encoding for transport, not security.
"I'll encrypt passwords" → If you can decrypt, so can attackers. Hash, don't encrypt.
"SHA-256 is secure" → SHA-256 is too fast. Use bcrypt/argon2.
"I need PayPal credentials to check balance" → Use PayPal's API with OAuth tokens. </common-mistakes>
<emergency-response>
If You Find Insecure Password Storage
IMMEDIATE ACTIONS:
- Stop the application (if running)
- Do NOT commit the code
- Implement proper hashing (bcrypt/argon2)
- Force password reset for all users
- Notify security team
- Assess breach scope
See references/emergency-response.md for complete migration guide. </emergency-response>
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtypescript/skills/hashing-passwords/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/djankies/claude-configs/hashing-passwords)