C++ Source Code Questions

Hi there! I coded a database with usernames and passwords. So people can log into their "own" account. But if people read the code they can see user/pass of other users and can login with that. So my question is, how to prevent that (encryption?).

Thanks in advance!
Last edited on
I do not need to hash the credentials do I? They can still copy paste
You need to store the hash of the password (say in a file in a secure location); you never store the cleartext password. When the user tries to log in, compute the hash of the entered password and check if it matches the stored hash.
Some more information: https://en.wikipedia.org/wiki/Passwd
Last edited on
Also note that salting helps against rainbow attacks. THis means storing the salted hash + salt in the database instead of just the unsalted hash.
https://stackoverflow.com/questions/1012724/what-exactly-is-a-rainbow-attack
https://en.wikipedia.org/wiki/Salt_(cryptography)
Last edited on
Topic archived. No new replies allowed.