[Tutorial] Properly Securing Passwords
#14

I think I have at least some clue what I'm talking about.

It's great to have a slow hash when it comes to security, you're absolutely right. But, the impact on the server performance is far from acceptable levels in my opinion.

I ran a test where I had a function called every 50 milliseconds, printing the value of GetTickCount function. I added another timer, repeated every second, hashing the password 65536 times like instructed in this tutorial. Then I drew a figure illustrating the time taken between calls to the 50 ms timer called func().



It is clear that the func() has to wait 300ms extra every time a password is hashed.


Here's the code used for the test:
pawn Code:
#include <a_samp>

native WP_Hash(buffer[], len, const str[]);

forward func();
forward hash();

main()
{
    SetTimer("func", 50, true);
    SetTimer("hash", 1000, true);
    return 1;
}

public func()
    printf("%d", GetTickCount());
   
public hash()
{
    new buffer[129], password[] = "password123";
    WP_Hash(buffer, 129, password);
   
    for(new i = 0; i != 65535; i++)
    {
        WP_Hash(buffer, 129, buffer);
    }
}
Reply


Messages In This Thread
Properly Securing Passwords - by SchurmanCQC - 22.02.2013, 00:59
Re: Properly Securing Passwords - by Luis- - 22.02.2013, 08:47
Re: Properly Securing Passwords - by SchurmanCQC - 22.02.2013, 10:55
Re: Properly Securing Passwords - by Babul - 22.02.2013, 11:12
Re: Properly Securing Passwords - by Johnson_boy - 22.02.2013, 12:00
Re: Properly Securing Passwords - by Jstylezzz - 22.02.2013, 12:02
Re: Properly Securing Passwords - by SchurmanCQC - 22.02.2013, 13:25
Re: Properly Securing Passwords - by Vince - 22.02.2013, 14:02
Re: Properly Securing Passwords - by SchurmanCQC - 22.02.2013, 14:06
Re: Properly Securing Passwords - by Vince - 22.02.2013, 14:40
Re: Properly Securing Passwords - by SchurmanCQC - 22.02.2013, 16:29
Re: Properly Securing Passwords - by Vince - 22.02.2013, 16:56
Re: Properly Securing Passwords - by Johnson_boy - 22.02.2013, 17:39
Re: Properly Securing Passwords - by Johnson_boy - 25.02.2013, 18:28
Re: Properly Securing Passwords - by Johnson_boy - 26.02.2013, 06:59
Re: Properly Securing Passwords - by playbox12 - 26.02.2013, 08:07
Re: Properly Securing Passwords - by SchurmanCQC - 08.07.2013, 15:27
Re: Properly Securing Passwords - by iTheScripter - 08.07.2013, 21:21
Re: Properly Securing Passwords - by Mindcode - 09.07.2013, 12:54
Re: Properly Securing Passwords - by BabyBauer - 17.07.2018, 14:54
Re: Properly Securing Passwords - by IdonTmiss - 17.07.2018, 17:43
Re: Properly Securing Passwords - by Calisthenics - 17.07.2018, 17:54
Re: Properly Securing Passwords - by AmigaBlizzard - 22.07.2018, 10:03

Forum Jump:


Users browsing this thread: 4 Guest(s)