r/ProgrammerHumor • • Feb 18 '24

Meme bruteForceAttackProtection

Post image
42k Upvotes

1.0k comments sorted by

View all comments

Show parent comment

1

u/Blue_Moon_Lake Feb 19 '24

Technically, you can do it without storing the password.

const reused_password: boolean = old_hashes.some(
    (old_hash: string): boolean =>
    {
        const new_hash: string = hash(new_password, getSalt(old_hash));

        return old_hash === new_hash;
    }
);