Live Demo

Cryptography & Security

Password hashing with bcrypt, session secrets, and safe patterns

bcrypt Password Hashing

Use ASPPY.crypto.Hash(password, rounds) to hash passwords.

Password*****
bcrypt hash$2b$10$Hef0iDiKSxCYB6wZjr89L.zNTFEe.fVjkD6DLf9MJFaAuY5S10xte
Length60 chars

Verify Password

Use ASPPY.crypto.Verify(password, hash) to check.

Stored hash: $2b$10$VQd/Nq6xLYtFrQg.z.lj4.lzdmh0kuTC0...

Try "testpassword" (correct) or any other value.

Secure Session Secret

Derive a per-session secret using bcrypt hash as key material.

Your session secret: $2b$10$q9eOQ03MA0mtRgENgi.hRuFttiB0pfezJ...

Generated once per session using bcrypt with a random seed.

Safe Password Storage Pattern

bcrypt already includes a random salt — just hash and store the result.

Password***********
Hash #1$2b$10$geRYyW1ADYTXAAx0AbgTwel/5kb8TI0o4/GXtUWR8sulH5Hb8inXi
Hash #2$2b$10$JW8QzBNaSdWhK5l7DBroLONpcfE6Vh80iWK/jevdJ2O4DQbIHHbz.
Same password?

Note: each hash is different because bcrypt generates a new random salt every time.