Question Salted encrypted database

Joined
Jun 11, 2016
Messages
16
Location
Sweden
Programming Experience
1-3
I am currently Making a database for accounts in My game. I have succesfully encrypted the accounts in sha 512 but i want to salt the acc details with sha 1 instead. The problem is , when the user input Their details it encrypts IT and check IF the hash is in the database. But salting makes the hash randomly generated. So My question is, how Do i encrypt It with salt and make the login function work?
 
You're supposed to store each user's salt in the database with their hashed password. Some systems will store it in its own column and some will store the salt and the hashed password together, concatenating the byte arrays and generating one base-64 string. When a user logs in, you use the user name to retrieve the salt and the hashed password from the database. You then use the salt to hash the password they entered and compare that to the hashed password from the database.
 
Back
Top