increasing time delay for login to stop bruteforcing, good idea?

ganjan picture ganjan · Jan 27, 2011 · Viewed 7.9k times · Source

I have set up my db to log every failed login attempt. I thought I would multiply the number of failed attempts with 0.05 seconds or something. Something like:

            time_nanosleep(0, (50000000 * $failed_attempts ) ); 

More attempts a hacker uses to guess a password, more time does it take to check every time. After checking a 100 passords he must wait 5 sec between each try.

Is this a good way to stop bruteforcing? I identify the users by IP. So I guess you can bruteforce the application by using multiple proxy servers or something, but besides that, I think is a good idea. What do you guys think?

Answer

Greg Buehler picture Greg Buehler · Jan 27, 2011

What about something like:

time_nanosleep(0, (10000000000 * (log($failed_attempts)^10)) ); 

This will give you an exponentially increasing attempt window.