# Bcrypt: Salt & Cost

> Why is bcrypt a better choice than SHA-256 for storing user passwords? Explain the salt and the cost factor.

Canonical: https://www.internhack.in/learn/interview/web-security/security-bcrypt-salting-work-factor
Last updated: 2026-11-28

Difficulty: Intermediate

## Question

Why is bcrypt a better choice than SHA-256 for storing user passwords? Explain the salt and the cost factor.

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Bcrypt, Salt, Cost Factor, Rainbow Tables, Argon2id

Previous: [Security Headers (Helmet)](https://www.internhack.in/learn/interview/web-security/security-secure-headers) · Next: [OAuth 2.0 & OpenID Connect](https://www.internhack.in/learn/interview/web-security/security-oauth2-flows) · [All of Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)

## More Web Security (OWASP, JWT, XSS, CSRF) questions

- [Session Fixation](https://www.internhack.in/learn/interview/web-security/security-session-fixation)
- [SSRF (Server-Side Request Forgery)](https://www.internhack.in/learn/interview/web-security/security-ssrf-vulnerability)
- [Clickjacking](https://www.internhack.in/learn/interview/web-security/security-clickjacking-protection)
- [Sanitizing vs. Validating](https://www.internhack.in/learn/interview/web-security/security-sanitizing-inputs)
- [Broken Access Control](https://www.internhack.in/learn/interview/web-security/security-broken-access-control)
- [Password Complexity](https://www.internhack.in/learn/interview/web-security/security-password-complexity)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)
