# Passwords

Passwords: Storing Passwords Safely: Hashing with pwdlib, Sign-Up and Sign-In Routes.

Updated: November 19, 2026

1. [Storing Passwords Safely: Hashing with pwdlib](https://www.ask-codey.com/lessons/fastapi-auth-passwords-and-hashing) (Journeyman): An API never stores a password, plain or encrypted, only a slow, salted, one-way hash of it made with Argon2 through pwdlib's PasswordHash.recommended(), and it checks each sign-in attempt with verify.
2. [Sign-Up and Sign-In Routes](https://www.ask-codey.com/lessons/fastapi-auth-sign-up-and-sign-in) (Journeyman): A students table with a password_hash column and a UNIQUE email holds the accounts, a sign-up route hashes the password and answers 201 with the new student or 409 for a used email, a response model keeps the hash out of every answer, and sign-in answers a wrong email and a wrong password with the same 401.

Source: https://www.ask-codey.com/courses/python-web-apis/topics/fastapi-passwords
