mardi 10 janvier 2017

Laravel default crypt method unexpected behaviour

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 .



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire