Performance: Password hashing with Werkzeug
MEDIUM IMPACT
This affects server response time during user authentication and overall backend processing speed.
from werkzeug.security import generate_password_hash # Using recommended default iteration count for good security and speed hashed_password = generate_password_hash('user_password')
from werkzeug.security import generate_password_hash # Using a very high iteration count or slow algorithm without reason hashed_password = generate_password_hash('user_password', method='pbkdf2:sha256:500000')
| Pattern | CPU Load | Response Delay | Security Level | Verdict |
|---|---|---|---|---|
| Excessive iterations in hashing | High CPU usage | High delay (~200-300ms) | Very high | [X] Bad |
| Default recommended hashing | Moderate CPU usage | Low delay (~50ms) | Good balance | [OK] Good |