dongzhan5246 2017-01-10 07:50
浏览 94

Laravel默认的crypt方法意外行为

I am trying to encrypt json encoded string from laravel's default encryption. But i am not sure it's using the AES-256-CBC The reason behind this i am also trying same encryption from AES custom class.

What i did.

  1. json_encode an array

  2. set the key ,mode and blocksize in AES custom class and generating the token.

  3. encrypt the token.

  4. set encrypted token using setData

  5. decrypt using AES custom class

Result is same as i was having in step1. When i tried to encrypt (Crypt::encrypt($requestToken);) and decrypt (Crypt::decrypt($encrypt)) is giving correct result. Now the problem is i am encrypting through (Crypt::encrypt($requestToken);) and want to decrypt through AES custom class. I am not sure that client is having laravel or not .

  • 写回答

1条回答 默认 最新

  • doushi9856 2017-01-10 08:18
    关注

    Check the Default key for encryption . Use same at both places

    评论

报告相同问题?

悬赏问题

  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢