Okay so I have a PHP script that creates user acounts and encrypts the password then saves it into the database. The login form just compares the users password with a password in the database. The database has a password to connect to and user name. Is this enough security for my sites login? Or is there other things I should be doing?
garyjohnson 14 Junior Poster
Recommended Answers
Jump to PostAs long as this is not a higly confidential banking or government site this might be enough. Hopefully you have done the password hashing as per good practices. You might want to check
Jump to PostPersonally, I'd use prepared statements (PDO flavour), BUT you need to validate the data too. All data from POST vars should be strings anyway, but you can check for integer or float or date formats, etc. If any of the inputs fall outside the allowed parameters, flag an error - …
Jump to PostOne more thing: if password is incorrect, do not tell that to the user; if username is incorrect, do not tell that to the user. Allways tell them that login failed, but not the reason. This way you give no clue to potential attacker.
All 11 Replies
cmps 26 Light Poster
veedeoo 474 Junior Poster Featured Poster
garyjohnson 14 Junior Poster
broj1 356 Humble servant Featured Poster
garyjohnson 14 Junior Poster
cmps 26 Light Poster
garyjohnson 14 Junior Poster
broj1 356 Humble servant Featured Poster

diafol
broj1 356 Humble servant Featured Poster
garyjohnson 14 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.