I am developing a Website using PHP 7.3, MySQL v5.6 and vanilla javascript. I'm currently only storing the customer's email and password for their authenticated database actions. I protected the password using PHP's password_hash
and password_verify
functions, but I'm storing the email address in plain text so I can retrieve it for sending the customer email messages as part of the function of the site. My client may ask me to store the customer's mailing address and other sensitive data in the future so that the customer can conveniently retrieve it for form submissions. Perhaps I need to seek out 2-way encryption, but I don't know how helpful that is since 2-way encryption seems useless if a hacker broken into your server.
What is the best practice today for storing and retrieving sensitive customer information in MySQL? I'd like to stick to the configuration I mentioned above (PHP, MySQL, JS).
UPDATE: I'm already protecting against injection and XSS. I'm only concerned with encryption at the moment.