Category: passlib

Problem

Securely hash passwords with bcrypt.

Solution

  hashed = bcrypt.hash("secret")
bcrypt.verify("secret", hashed)
  

Notes

  • Adapt variable names and paths to your project
  • Add error handling for production use
  • See related chapters in the Learning Path