Welcome Guest, Not a member yet? Register   Sign In
SHA1 hashes, passwords and lengths
#1

[eluser]the future darlo manager[/eluser]
Just sorting out my user creation system for a work project and wanted to ask a few quick questions about SHA1.

Firstly how many characters does this create? My passwords can be a max of 20 characters long when the user enters them in.

Also for checking the password am I right in thinking the best of checking them is to take the password the user has entered, hash it and then compare that value with the hashed valued in the database?
#2

[eluser]AgentPhoenix[/eluser]
Quote:Firstly how many characters does this create? My passwords can be a max of 20 characters long when the user enters them in.

It doesn't matter how long the password is, the SHA1 hash will always be 40 characters long.

Quote:Also for checking the password am I right in thinking the best of checking them is to take the password the user has entered, hash it and then compare that value with the hashed valued in the database?

Yep, that's the way I'm doing it. Smile
#3

[eluser]Crimp[/eluser]
Add salt.




Theme © iAndrew 2016 - Forum software by © MyBB