View Full Version : How is salt created?
Shining Arcanine
Thu 8th Apr '04, 10:27pm
Would someone please tell me how salt (the kind that is added to passwords) is created?
daemon
Fri 9th Apr '04, 1:19am
To create the salt they first have a for() loop which will run until the desired length. In that loop, they add onto a string ($salt). What they add on is a mixture of two functions: rand() and chr():
chr(rand());
First the run rand, with the minimum being the lowest character number (on the ASCII table) they want, with the maximum being the biggest. So, that is 32 and 126. Then the chr() function looks up the character number in the ASCII table and returns the letter.
If you want to see exactly how it is done, open up ./includes/functions_user and look for fetch_user_salt.
Shining Arcanine
Sat 10th Apr '04, 2:07am
To create the salt they first have a for() loop which will run until the desired length. In that loop, they add onto a string ($salt). What they add on is a mixture of two functions: rand() and chr():
chr(rand());
First the run rand, with the minimum being the lowest character number (on the ASCII table) they want, with the maximum being the biggest. So, that is 32 and 126. Then the chr() function looks up the character number in the ASCII table and returns the letter.
If you want to see exactly how it is done, open up ./includes/functions_user and look for fetch_user_salt.
Thanks. :D
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.