libertylocked / eth-ecies Goto Github PK
View Code? Open in Web Editor NEWEthereum ECIES library, for easy encryption using Ethereum keys
Home Page: https://www.npmjs.com/package/eth-ecies
Ethereum ECIES library, for easy encryption using Ethereum keys
Home Page: https://www.npmjs.com/package/eth-ecies
Hi,
I just ran your code example and get the following error:
TypeError [ERR_INVALID_ARG_TYPE]: The "list[1]" argument must be one of type Array, Buffer, or Uint8Array. Received type string
This is the code that I'm running:
const ecies = require("eth-ecies");
const ethPubKey = "1e7bcc70c72770dbb72fea022e8a6d07f814d2ebe4de9ae3f7af75bf706902a7b73ff919898c836396a6b0c96812c3213b99372050853bd1678da0ead14487d7"
let plaintext = new Buffer(`{foo:"bar",baz:42}`);
let encryptedMsg = ecies.encrypt(ethPubKey, plaintext);
console.log(encryptedMsg)
I was confused with ECIES and couldn't find a suitable example. Can I ask you some questions?
Hi! Amazing work. Simple and great! My question is how many times can a keypair (publickey, privatekey) can be reused to encrypt/decrypt data. Does it require only once, or can it be reused multiple times? Thanks
I've been running into this error when i try to use the decrypt function in my react-app.The same code works perfectly on my node-js server but throws this error in the react app.
The code is given below:
async decrypt(privateKey, encryptedData) {
let userPrivateKey = new Buffer(privateKey, 'hex');
let bufferEncryptedData = new Buffer(encryptedData, 'base64');
let decryptedData = ecies.decrypt(userPrivateKey, bufferEncryptedData);
console.log(decryptedData)
return decryptedData.toString('utf8');
}
async handlesubmit(e)
{
var data="B/9Z1awURZ4x46HpwAc0FARGaFXUGig7eLn2h5HcejkB79JLkDbYp5916yKvfHJTjnAljYxLa4UxFCYDfeutp9H67gO+H8Lw/zhrdh2UWYIU1BTAj1YSAqneb4XuZaih6GXFv/mUaed8r9yRhLHs6+GQ1qdD1mqhKhZEbB9/Y5MafUO/N0f0/ZB3T8Tr1zD04A=="
var pvtkey="616c0f618793eb4ffc03ddcc793e451803067d8d3cde435fd7a517c7c290cf20"
var fans = await this.decrypt(pvtkey.toString(),data.toString());
console.log(fans)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.