LuckyBoy LuckyBoy - 1 year ago 142
MySQL Question

What are the Pros and Cons of Hashing Entire MySQL Database in PHP Bcrypt?

I have seen on the internet that it is a good practice of hashing user names and passwords using BCrypt for better security. If your database was compromised, there would be still a chance for your data (User Names and Passwords) keep secret. So my problems are,

  1. Can we hash All Database Tables (not only tbl_users) for better security.? (such as comments, payments, balance, etc...)

  2. If we can, does it slows down the PHP Application?

  3. Other Advantages and Disadvantages

  4. Any other methods which can use for keeping data secret, if my database was hacked, stolen of compromised?

Thank you in advance..!

Answer Source
  1. Hashing is one way only. That means if you want to retrieve the first and last name of your user, you won't be able to. Another example is if you hash balances, you won't be able to see who owns the most money, or who owes what.
  2. Hashing, or encrypting is slow. That's one reason why it is secure, because you need a big computing power to be able to break it.
  3. Other advantages? None.
  4. Something that banks use, along other things. Is to have your database table names and column names be meaningless... Name them just a,b,c,d that way it is harder to know what is what. But again, that is just a slim layer of security by obscurity. If the database is hacked and its content pumped out, the hacker will have all the time he needs to figure out what he needs...

Try reading more on how to manage your database securely on

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download