dst8922 2014-03-31 16:03
浏览 89
已采纳

DES_DECRYPT和DES_ENCRYPT:MySql和phpMyadmin

I have an issue using DES_DECRYPT & DES_ENCRYPT in MySQL.

When I run the following select clause in phpmyadmin

SELECT DES_DECRYPT(DES_ENCRYPT('mytext','mypassword'),'mypassword'); 

It returns

DES_DECRYPT(DES_ENCRYPT('mytext','mypassword'),'mypassword') 6d7974657874

Normally it should return mytext again, right?

When I run it inside php, it works like a charm. Anyone knows what I did wrong here ?

External link

  • 写回答

2条回答 默认 最新

  • du2229 2014-03-31 16:07
    关注

    Works fine here:

    mysql> select des_decrypt(des_encrypt('foo', 'bar'), 'bar');
    +-----------------------------------------------+
    | des_decrypt(des_encrypt('foo', 'bar'), 'bar') |
    +-----------------------------------------------+
    | foo                                           |
    +-----------------------------------------------+
    1 row in set (0.00 sec)
    

    Which version of MySQL are you using, and how are you running the query/displaying the results?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作