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$2J1Ewpn4Q3/rs.h.BQJ.t.h4N1toj2W9PvTAb3pryM79EcDadn8w. |
| Length | 60 chars |
Verify Password
Use ASPPY.crypto.Verify(password, hash) to check.
Stored hash: $2b$10$WksRcQPjeZOp1vw0A8hTWeS0eNlk5/xuo...
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$ob4BzOchVPGLX.orxvN.0OEqz0N.WLcqm...
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$zhWvv8i1VWEKMyeyvdz5JeTb2tbKwVo0VsQh8ICjSwkPHlcaalqLS |
| Hash #2 | $2b$10$XH84B.WoMK/14WumlPD/pOFx9J6r5Ib49ENC1a3hdY2jAGTc.Wg72 |
| Same password? |
Note: each hash is different because bcrypt generates a new random salt every time.