The hashlib module provides cryptographic hash functions. md5 and sha1 are cryptographically broken — findings for password hashing / signature use. For password hashing use hashlib.scrypt, pbkdf2_hmac, or the passlib / argon2-cffi packages.
.pbkdf2_hmac().scrypt().md5().sha1().md5()Sinkhashlib.md5(data: bytes = b'', *, usedforsecurity=True) -> Hash
MD5 hash. Broken for cryptographic use — finding for password hashing or digital signatures.
.sha1()Sinkhashlib.sha1(data: bytes = b'', *, usedforsecurity=True) -> Hash
SHA-1 hash. Broken for cryptographic use — finding for signature contexts.
.pbkdf2_hmac()Sanitizerhashlib.pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> bytes
Password-based key derivation. Safe with iterations ≥ 100_000.
return.scrypt()Sanitizerhashlib.scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64) -> bytes
Memory-hard password hash. Safe.
return.sha256()Neutralhashlib.sha256(data: bytes = b'') -> Hash
SHA-256 hash. Acceptable for digests; use scrypt / pbkdf2 for passwords.
| FQN | Field | |
|---|---|---|
| hashlib | fqns[0] |
Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.
from codepathfinder.go_rule import PyHashlib