AES encryption in mysql and php

后端 未结 4 1246
夕颜
夕颜 2020-12-22 12:02

There is a function in Mysql AES_encrypt.

SELECT AES_encrypt( \"Hello World\", \"password\" ) AS encrypted_value 

This gives the result:

4条回答
  •  暖寄归人
    2020-12-22 12:21

    The MySQL AES_encrypt uses a 128-bit key length - Reference here

    Whereas your PHP code uses 256-bit key lengths.

    To fix the problem you should be able to uses 'MCRYPT_RIJNDAEL_128' instead of 256.

提交回复
热议问题