Last active
March 8, 2018 13:35
-
-
Save hm0429/b7a51de4e24175b638ef97a632e97e4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install eth-crypto --save | |
const EthCrypto = require('eth-crypto'); | |
const publicKey = 'fff49b58b83104ff16875452852466a46c7169ba4e368d11830c9170624e0a9509080a05a38c18841718ea4fc13483ac467d3e2d728d41ff16b73b9c943734f8'; | |
const message = "piyo!"; | |
(async() => { | |
const encryptedMessage = await EthCrypto.encryptWithPublicKey(publicKey, message); | |
console.log(encryptedMessage); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment