Support the ongoing development of Laravel.io →
Security
Last updated 7 months ago.
0

I same problem . What should i do ? please help me

0

here is solution :

 // Include the CryptoJS and Base64 JS.
var encrypted = '{{ $encrypted }}';
var key = "{{ $key }}";

var encrypted_json = JSON.parse(Base64.decode(encrypted));
/*
This looks like this: 
{
    "iv":"LjF1hMU/z9TYX14BTKHO+g==",
    "value":"A2r3MRwTzS67Id4/TmXZKG71vGF1prjQ8oaGrThjKw4=",
    "mac":"6762445e827e2e4acff56ee600b250efe48c71aa75ac65bd50fd42e1e59e671c"
}
*/

// Now I try to decrypt it.
var decrypted = CryptoJS.AES.decrypt(encrypted_json.value, CryptoJS.enc.Base64.parse(key), {
       iv : CryptoJS.enc.Base64.parse(encrypted_json.iv)
});

console.log(decrypted.toString(CryptoJS.enc.Utf8));
Last updated 4 years ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.