Ruby on Rails Password Hash Generator
Generate a real bcrypt hash matching what Rails' has_secure_password (via the bcrypt gem) produces - directly usable with authenticate().
This generates a real bcrypt hash in the exact format Rails' has_secure_password (via the bcrypt gem) produces and verifies.
Computed using a real bcrypt implementation running entirely in your browser - your password is never transmitted anywhere.
No Ruby code is executed - this is a genuine, algorithm-correct bcrypt hash matching the format Rails expects in the password_digest column.
How Rails Hashes Passwords
Rails' has_secure_password macro (from ActiveModel, backed by the bcrypt gem) stores a standard bcrypt hash in the model's password_digest column - the same underlying bcrypt algorithm and hash format used across most languages.
Why Use This Tool?
Useful for seeding a Rails database directly (e.g. via db/seeds.rb raw values or a fixture) without needing Rails running, or for understanding exactly what gets stored in password_digest.
How to Use It
- Enter a password.
- Set the cost factor (Rails/bcrypt gem commonly defaults to a cost of 10-12).
- Copy the generated hash directly into your
password_digestcolumn.
Understanding the Output
Once inserted into password_digest, a model using has_secure_password can authenticate it normally via user.authenticate('the-password'), since Rails is just calling the same standard bcrypt verification underneath.