feat: implement bcrypt algorithm

This commit is contained in:
2025-11-13 13:17:18 +00:00
parent 30f1f45d68
commit 6ca905cd1e
3 changed files with 63 additions and 0 deletions

View File

@@ -52,3 +52,17 @@ def test_argon2_algorithm_identifier():
"""Verify Argon2 algorithm has correct identifier."""
algo = get_algorithm("argon2")
assert algo.identifier == "argon2"
def test_bcrypt_algorithm_hash_round_trip():
"""Verify bcrypt algorithm can hash and verify passwords."""
algo = get_algorithm("bcrypt")
salt, hashed = algo.hash("test password")
assert algo.verify("test password", salt, hashed)
assert not algo.verify("wrong password", salt, hashed)
def test_bcrypt_algorithm_identifier():
"""Verify bcrypt algorithm has correct identifier."""
algo = get_algorithm("bcrypt")
assert algo.identifier == "bcrypt"