MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _verify_password

Method _verify_password

auth_manager.py:205–214  ·  view source on GitHub ↗

Verify a password against stored hash and salt.

(password: str, stored_hash: str, stored_salt: str)

Source from the content-addressed store, hash-verified

203
204 @staticmethod
205 def _verify_password(password: str, stored_hash: str, stored_salt: str) -> bool:
206 """Verify a password against stored hash and salt."""
207 salt = bytes.fromhex(stored_salt)
208 pw_hash = hashlib.pbkdf2_hmac(
209 'sha256',
210 password.encode('utf-8'),
211 salt,
212 AuthManager.PBKDF2_ITERATIONS
213 )
214 return secrets.compare_digest(pw_hash.hex(), stored_hash)
215
216 # =========================================================================
217 # FERNET KEY WRAPPING

Callers 4

loginMethod · 0.95
change_passwordMethod · 0.95
recoverMethod · 0.95

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected