I've written a login system in PHP, using a MySQL-database. Currently I'm just saving the users' email-addresses as plaintext in the database. But I'm wondering if I would be better off encrypting these email-addresses to decrypt them later on when I need them.
Let's say, if someone would actually be able to inject some SQL inside a query, and make the entire users-table appear on his screen, he would be able to view all email-addresses in the database and spam them with full power.
Would storing encrypted email-addresses be an interesting thing to do, or not? The fact that I use PHP actually doesn't matter.
BTW: As far as I know my login-system is completely safe for SQL-injection (mysqli_real_escape_string) and XSS-attacks (htmlspecialchars) (as far as I know).