MySQL - How to store AES_Encrypted data?

后端 未结 4 722
天命终不由人
天命终不由人 2020-12-31 04:50

So I have been browsing the internet, and came across the MySQL built-in function AES_ENCRYPT. It doesn\'t seem too hard to use, but some sources tell me to store the encryp

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 05:31

    If you need to use VARCHAR, rather than BLOB, then convert the encrypted binary to Base64 which only uses printable characters and can be safely stored as VARCHAR. Of course you will need to convert it back from Base64 to binary before decrypting.

提交回复
热议问题