
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ecies-parity
Advanced tools
JavaScript Elliptic Curve Integrated Encryption Scheme Library - Based of Parity's implementation
This is a javaScript Elliptic curve Integrated Encryption Scheme (ECIES) library for both browserify and node.js. This implementation mimics parity's rust implementation to allow dapps to encrypt/decrypt messages from parity's extended JSON RPC API.
This module is a modified version of the eccrypto javascript library.
Parity has implemented ECIES encryption and decryption for arbitrary messages through its extended JSON RPC API. Other Ethereum clients, (i.e. Metamask, go-ethereum) have not implemented such encryption. Dapps wishing to utilise Parity's features but also facilitate other Ethereum clients may require encrypting and decrypting Parity's messages in the browser. This package is designed to facilitate such tasks.
As with eccrypto, this library provides two implementations for Browser and Node.js with the same API.
The ECIES implementation details mimic those introduced by Parity, which are
The ECIES implementation given here is solely based off Parity's implementation. This module offers no guarantees as to the security or validity of the implementation. Furthermore, this project is being actively developed and as such should not be used for highly sensitive information.
Although this module is primarily developed for ECIES encryption/decryption extra elliptic curve functionality is given.
const crypto = require("crypto");
const ecies = require("ecies-parity");
var privateKeyA = crypto.randomBytes(32);
var publicKeyA = ecies.getPublic(privateKeyA);
var privateKeyB = crypto.randomBytes(32);
var publicKeyB = ecies.getPublic(privateKeyB);
// Encrypting the message for B.
ecies.encrypt(publicKeyB, Buffer.from("msg to b")).then(function(encrypted) {
// B decrypting the message.
ecies.decrypt(privateKeyB, encrypted).then(function(plaintext) {
console.log("Message to part B:", plaintext.toString());
});
});
// Encrypting the message for A.
ecies.encrypt(publicKeyA, Buffer.from("msg to a")).then(function(encrypted) {
// A decrypting the message.
ecies.decrypt(privateKeyA, encrypted).then(function(plaintext) {
console.log("Message to part A:", plaintext.toString());
});
});
const crypto = require("crypto");
const ecies = require("ecies-parity");
// A new random 32-byte private key.
var privateKey = crypto.randomBytes(32);
// Corresponding uncompressed (65-byte) public key.
var publicKey = ecies.getPublic(privateKey);
var str = "message to sign";
// Always hash you message to sign!
var msg = crypto.createHash("sha256").update(str).digest();
ecies.sign(privateKey, msg).then(function(sig) {
console.log("Signature in DER format:", sig);
ecies.verify(publicKey, msg, sig).then(function() {
console.log("Signature is OK");
}).catch(function() {
console.log("Signature is BAD");
});
});
const crypto = require("crypto");
const ecies = require("ecies-parity");
var privateKeyA = crypto.randomBytes(32);
var publicKeyA = ecies.getPublic(privateKeyA);
var privateKeyB = crypto.randomBytes(32);
var publicKeyB = ecies.getPublic(privateKeyB);
ecies.derive(privateKeyA, publicKeyB).then(function(sharedKey1) {
ecies.derive(privateKeyB, publicKeyA).then(function(sharedKey2) {
console.log("Both shared keys are equal:", sharedKey1, sharedKey2);
});
});
FAQs
JavaScript Elliptic Curve Integrated Encryption Scheme Library - Based of Parity's implementation
The npm package ecies-parity receives a total of 12 weekly downloads. As such, ecies-parity popularity was classified as not popular.
We found that ecies-parity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.