# bcrypt Guide

Hash a password with bcrypt, or verify one against a hash.

- Tool: https://ilham.dev/tools/bcrypt/
- Guide URL: https://ilham.dev/guides/bcrypt/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Security and Cryptography Basics for Developers (https://ilham.dev/guides/security-cryptography-basics/)

## What it does

Hash a password with bcrypt, or verify a password against an existing bcrypt hash. The cost factor controls how much work each hash takes, and that expense is the whole point.

## Use the tool

Open https://ilham.dev/tools/bcrypt/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Crypto.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### Which cost factor should I use?

The highest one your server can afford at login time. The tool reports how long each hash took, which is the number that matters — a login should not take much more than about 250 ms.

### Why does the same password give a different hash every time?

Because bcrypt generates a random salt per hash and stores it inside the result. That is what stops two users who chose the same password from having the same hash.