Closed GoogleCodeExporter closed 9 years ago
When you first create the salt, it's a WordArray object. Then when you save it
to local storage, it's converted to a string of hex digits. To get the original
WordArray back, you'll have to parse the hex.
Example:
var salt = CryptoJS.enc.Hex.parse( localStorage.getItem("salt") );
Also, there's a discussion group for usage questions
(https://groups.google.com/forum/?fromgroups#!forum/crypto-js). An "issue" is
supposed to be for bug reports or enhancement requests.
Original comment by Jeff.Mott.OR
on 15 Oct 2012 at 8:40
Very sorry about that i will take my future questions there!
Now i get the right key but i still can't decrypt should i do something like
this cprEntrypt also.
var salt = CryptoJS.enc.Hex.parse(localStorage.getItem("salt"));
var iv = CryptoJS.enc.Hex.parse(localStorage.getItem("iv"));
var cprEncrypt = localStorage.getItem("cpr");
var key = CryptoJS.PBKDF2("pin", salt, { keySize: 128 / 32, iterations: 4 });
var decrypt = CryptoJS.AES.decrypt(cprEncrypt, key, { 'iv': iv });
Thanks for the quick response.
Original comment by mikkelse...@gmail.com
on 15 Oct 2012 at 9:56
My bad was missing the aes script in the manifest file to my html5 offline page.
Thanks for the help!! And once agian sorry about the misplacing of the thread.
Original comment by mikkelse...@gmail.com
on 15 Oct 2012 at 12:32
Original comment by Jeff.Mott.OR
on 15 Oct 2012 at 11:42
Original issue reported on code.google.com by
mikkelse...@gmail.com
on 15 Oct 2012 at 8:27