Closed GoogleCodeExporter closed 8 years ago
A number of problems here. First, in the openssl command, you provide a
password even though you've already provided both a key and IV. I don't think
the password even comes into play anymore. Second, the input to a formatter's
stringify method must be a cipher params object, which your object isn't. If
your whole JSON object was one long string, then you could convert it to a
cipher params object with JsonFormatter.parse.
Original comment by Jeff.Mott.OR
on 18 Jun 2013 at 4:05
Thanks Jeff. i am getting empty value if i follow your suggestion. Can you
please correct me where i am getting it wrong.
var decrypted =
CryptoJS.AES.decrypt(JsonFormatter.parse(JsonFormatter.stringify(encrypted)),
"ABC123", { format: JsonFormatter });
console.log(decrypted.toString(CryptoJS.enc.Utf8));
Original comment by chintani...@gmail.com
on 18 Jun 2013 at 4:53
var encrypted =
JsonFormatter.parse('{"ct":"SkcuPuz7/nelTfCbCisuKA==","iv":"58A5C8CC233A21DE8D98
90CF843A3AA9"}');
var key =
CryptoJS.enc.Hex.parse('BBF2DEAD374654CBB32A917AFD2366568458966D4E432EA50AD491B4
C49515BF');
var decrypted = CryptoJS.AES.decrypt(encrypted, key, { iv: encrypted.iv });
alert(decrypted.toString(CryptoJS.enc.Utf8));
Original comment by Jeff.Mott.OR
on 18 Jun 2013 at 5:30
wow..thanks a lot. really appreciate your quick response.
Original comment by chintani...@gmail.com
on 18 Jun 2013 at 5:32
Original comment by Jeff.Mott.OR
on 19 Jun 2013 at 12:25
Hi Jeff,
We are getting some unique problem for a specific client.
The problem is we are using cryptography for password encryption and we are
successfull in doing this But when we try to decrypt the password it is not
returning the exact value what we have given instead it is giving the value as
encypted string. For eg:
Password is "ABC" -> encrypted to "77464646==" and when we are trying to
decrypt ("77464646==") we are getting output as "77464646==".
Please help me in this.
Regards,
Naresh Yakkala.
Original comment by nareshya...@gmail.com
on 13 Aug 2013 at 7:27
Hi, Naresh. It's almost impossible to see the problem without seeing the code
you're using. Also, consider posting in the discussion group rather than
posting to a closed issue.
Original comment by Jeff.Mott.OR
on 13 Aug 2013 at 6:49
Original issue reported on code.google.com by
chintani...@gmail.com
on 18 Jun 2013 at 3:32