how to encrypt emails in mysql database but still be able to query them?

后端 未结 3 1062
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 16:37

I want to store the email addresses of users in a MySQL database using encryption to ensure that they won\'t be made public if the database gets compromised. I believe if I encr

3条回答
  •  一个人的身影
    2021-02-04 17:12

    AES_DECRYPT(email, 'secretkey') and AES_ENCRYPT(email, 'secretkey') is optimal solution,

    I am not 100% sure about beeing unique after encryption but theory said if email is unique encription should be unique

提交回复
热议问题