r/AskComputerScience • u/benmarvin • Apr 08 '26
Why does it take my computer slightly longer to tell me when I've entered the wrong login password than when I enter the right password?
I've noticed this on both Windows and Linux. If I enter the correct password, it almost instantly starts the login. But if it's the wrong password it takes like a second or so to tell me it's wrong.
34
Upvotes
View all comments
Show parent comment
-2
u/Ronin-s_Spirit Apr 08 '26
I think you don't need to make every check take the same amount of time (which leads to slow behavior if you take a fat timing margin). You just need to run the check on the given password instead of running it on the correct password.