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?).
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