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

    评论

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波