Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techeng322/eth-ecies
Ethereum ECIES library, for easy encryption using Ethereum keys
https://github.com/techeng322/eth-ecies
Last synced: 18 days ago
JSON representation
Ethereum ECIES library, for easy encryption using Ethereum keys
- Host: GitHub
- URL: https://github.com/techeng322/eth-ecies
- Owner: techeng322
- Created: 2023-11-08T19:54:26.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-17T15:58:18.000Z (about 1 year ago)
- Last Synced: 2024-01-15T10:34:57.930Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/eth-ecies
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
eth-ecies
---
ECIES encrypt/decrypt library for Ethereum# Usage
## Encrypt
```javascript
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
```javascript
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 HMAC-SHA256 is used as AEAD algorithm.