Created
December 5, 2021 17:34
-
-
Save xmpf/11a3ccb2586416b27a0a67ab3e3e9ae9 to your computer and use it in GitHub Desktop.
Generate Private and Public key using Node
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 node-rsa | |
const NodeRSA = require('node-rsa'); | |
const keyPair = new NodeRSA({b: 512}).generateKeyPair(); | |
const publicKey = keyPair.exportKey('public') | |
const privateKey = keyPair.exportKey('private') | |
console.log(publicKey); | |
console.log("\n\n"); | |
console.log(privateKey); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment