Previously the format of UTC file was:-
{"version":3,"id":"09ddd0cf-76ed-4254-8912-adedb549fbcb","address":"e97a49f8e62767dad8d61c2e951eafb28a0adb37","Crypto":{"ciphertext":"b887c29ba299793af2ec9535fe6934b04ae34cbc1b745396eaea3ac931b593dd","cipherparams":{"iv":"7dfd0a849313c0e84e302b527c343499"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"ad883dc67f42508c56e467969d58d8abac3ab5360c61e515a80bddff6dfcf964","n":1024,"r":8,"p":1},"mac":"6d1d8c50fcb1498e38479498169b3692f018e96f40aa4d972bd6578b761a1d30"}}
And when we use web3.account.encrypt it generated like this
{"version":3,"id":"09ddd0cf-76ed-4254-8912-adedb549fbcb","address":"e97a49f8e62767dad8d61c2e951eafb28a0adb37","crypto":{"ciphertext":"b887c29ba299793af2ec9535fe6934b04ae34cbc1b745396eaea3ac931b593dd","cipherparams":{"iv":"7dfd0a849313c0e84e302b527c343499"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"ad883dc67f42508c56e467969d58d8abac3ab5360c61e515a80bddff6dfcf964","n":1024,"r":8,"p":1},"mac":"6d1d8c50fcb1498e38479498169b3692f018e96f40aa4d972bd6578b761a1d30"}}
So while decrypting only second one will work (web3.account.decrypt). This is just because of Crypto in UTC file.
I encountered the issue.
ALSO it should be an async function, it takes 5 to 10 seconds to decrypt
@anurag-lala I was going back in the commit history and the crypto property was always written lower case in 1.0. I will close this issue because there isn't something I have to fix but feel free to ping me here again and we can discuss further steps.
@alexbourdon Yes, you are right it should be an async function. I've written this down on my todo list and will change this probably on the 1.3.0 release.
Most helpful comment
I encountered the issue.
ALSO it should be an async function, it takes 5 to 10 seconds to decrypt