Whenever I type the wrong password on my Ubuntu/Gmail etc it takes some time to ask for password again. But if when I type the right password it immediately logs in.
Why? Is it because the algorithms’s best case input is the correct password? Is it illusion then what causes it?
This is a common security measure, to prevent unauthorized users from trying a large number of strings to find your password. By making a short pause after an incorrect entry, it slightly incoveniences the user who enters the wrong password, but it greatly increases the protection from that sort of attack.