Skip to content

Instantly share code, notes, and snippets.

@hm0429
Created March 8, 2018 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hm0429/891e280b95b80eff9eef42e469be758f to your computer and use it in GitHub Desktop.
Save hm0429/891e280b95b80eff9eef42e469be758f to your computer and use it in GitHub Desktop.
// npm install eth-crypto --save
const EthCrypto = require('eth-crypto');
const privateKey = '0x61ce8b95ca5fd6f55cd97ac60817777bdf64f1670e903758ce53efc32c3dffeb';
const encryptedMessage = {
iv: '3c12aa4bdbb6219479eb0ebe62ee908f',
ephemPublicKey: '04f70ca0c9e6741c8709de1cfec75f980823dd753b9c1a87cc4afbfdf44707b1830c0385b0fa808fa18f55a5f7551370242d95cd61546823fda2f73d26e1906a81',
ciphertext: 'a21abfac3a44ca4c22bdfb23a97a115f',
mac: 'b4d282d05422672689bd1027c948b2189dc52e7f9101e753be6fb3df844572c4'
};
(async() => {
const decryptedMessage = await EthCrypto.decryptWithPrivateKey(privateKey, encryptedMessage);
console.log(decryptedMessage);
})();
@binzram
Copy link

binzram commented Mar 8, 2018

piyo! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment