EOSIO / eosjs-ecc

Elliptic curve cryptography functions: Private Key, Public Key, Signature, AES, Encryption, Decryption
288 stars 119 forks source link

Can I use eosjs-ecc to decrypt wallet file? If not, what should I do? #10

Closed iWtbAbh closed 6 years ago

iWtbAbh commented 6 years ago

Hello, I have a test wallet and the content is

{
  "cipher_keys": "702e87d25a5acb0bb64b1cfa6045f51f86092a58f1d88c9c2caff0d69d7024bcbff6b68972b4b3d2ae8e0b83e3a23bff79e2d6a21aed9b1a341ee8d0d9f981b220a5e36802f056d27797a939ac5d0349fb16bdeb596fc1c24262cf292757e515d0f9ac84fb66fecfdc5e8574f734768d67c09745bb5b4c01f2f170339dfe4b0d3ee2af4c164f521a8fc07c860473849e"
}

Can I use eosjs-ecc to decrypt it? If not, what should I do?

Please help me, thank you.

jcalfee commented 6 years ago

You need to know all about the format in cipher_keys .. The decryption is all AES 256 bit and found here:

https://github.com/EOSIO/eosjs-ecc/blob/v3.0.3/src/aes.js#L125

Using these libraries and your own implementation is actually very little code and apart from a learn curve can be very easy to do. Just make sure you get a code review to be sure your not breaking a security rule. There are several stack exchange sites that will help with this kind of thing: security, crypto ..

iWtbAbh commented 6 years ago

it's very helpful to me, thanks!