eth-ecies

1.0.6 • Public • Published

eth-ecies

ECIES encrypt/decrypt library for Ethereum

Usage

Encrypt

const ecies = require("eth-ecies");
let plaintext = new Buffer(`{foo:"bar",baz:42}`);
let encryptedMsg = ecies.encrypt(ethPubKey, plaintext);
// encrypted message is a 113+ byte buffer

Decrypt

const ecies = require("eth-ecies");
let plaintext = ecies.decrypt(ethPrivKey, encryptedMsg);

Notes

To derive the public key from a private key, you can use ethereumjs-util module

Security

The ECIES implementation uses fixed Diffie-Hellman (ephemeral-static) key exchange and provides no Perfect Forward Secrecy (PFS). AES-256-CBC is used as AEAD algorithm.

Readme

Keywords

none

Package Sidebar

Install

npm i eth-ecies

Weekly Downloads

138

Version

1.0.6

License

MIT

Unpacked Size

9.18 kB

Total Files

5

Last publish

Collaborators

  • libertylocked