Learn about important database security methods in PHP and how to make it secure and unbreakable against hackers today.
We all know that security is a top priority everywhere.
No matter if you run a small business, have patient information, or have a personal computer at home, we all have to guard our data somehow.
Even the government has procedures to follow in order to avoid classified information to be leaked or hacked by foreign enemies. It’s imperative to have data locked safely. You want to avoid any vulnerabilities at all costs.
To prevent hackers from knowing usernames and passwords, we want to encrypt them. We need to do somethings first in our database. We are going to change the values in our database to make it longer.
Change the length or values to 100 or 200
Use the $hashFormat = “$2y$10$”; (This is the blowfish method)
Use $salt = “iusesomecrazystrings22”; (this takes in 22 characters)
You can see and learn about these more in depth at php.net
Another resource I want to point out is about password hash at the documentation for php, which is excellent reference explaining about blowfish and salt and hash (See php password_hash)
So when you type in a password this will generate a different password characters, thus encrypting the password so it makes it impossible for hackers to break in with their hacker software
There’s also other hash functions you can use that creates even longer password strings and it’s excellent. However, this is the one I learned so far, but if I get to use other functions in the future I will probably refer to the php documentation for help again.
This was a great experience learning about database security methods in php. It was also wonderful passing this information to everyone in the community.
Security is very important against keeping the bad guys out and I highly recommend to keep your usernames and passwords secure in your applications. It would be a devastating blow if anything would be lost. We don’t want your users to be compromised in anyway, especially if there’s financial information, so be safe everyone.