Why is AES_DECRYPT returning null?

前端 未结 4 1997
小鲜肉
小鲜肉 2020-12-18 04:04

I\'ve found similar questions, but no clear answer for this question. I have this table:

CREATE DATABASE testDB DEFAULT CHARACTER SET utf8 COLLATE utf8_gener         


        
4条回答
  •  时光说笑
    2020-12-18 04:27

    When you insert binary data into a VARCHAR field there are some binary characters that a VARCHAR can't handle and they will mess up in the inserted value. And then the inserted value will not be the same when you retrieve it. 1.select hex(aes_encrypt(file,'key')); 2.select aes_decrypt(unhex(file),'key');

提交回复
热议问题