1

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.

chillywilly
  • 405
  • 3
  • 11
  • 1
    Does this answer your question? [How can I store sensitive data securely in a MySQL database?](https://stackoverflow.com/questions/15059761/how-can-i-store-sensitive-data-securely-in-a-mysql-database) – Hirumina Apr 06 '20 at 09:45
  • 1
    Take a look at [CipherSweet](https://ciphersweet.paragonie.com), which allows you to not only encrypt data at rest, but also allow it to be searchable. – Synchro Apr 06 '20 at 10:07
  • Thank you both for your help! I'm still curious about what is considered "best practice" given my constraints, but I'm glad to have a path forward! – chillywilly Apr 06 '20 at 19:59

0 Answers0