keybase-encrypt

2.0.0 • Public • Published

keybase-encrypt Build Status

js-standard-style

🔑 Using kbpgp to encrypt messages based on a public key

Install

$ npm install keybase-encrypt --save

Usage

const encrypt = require('keybase-encrypt')
 
const publicKey =  `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v2.0.56
Comment: https://keybase.io/jjperezaguinaga
 
xsFNBFfglq0BEADTvFWRPl18pcBKQmQH8WaiGQ+JXZScuv1PXAcereGrObZbQ4oN
...
`
 
const message = 'This is a test'
 
try {
  encrypt(publicKey, message).then(encryptedMessage => {
    console.log(encryptedMessage)
    /*
    -----BEGIN PGP MESSAGE-----
    Version: Keybase OpenPGP v2.0.62
    Comment: https://keybase.io/crypto
 
    wcBMA6gpy0Zv/UOFAQf7BU9CCbsM4noJbsCz9sW7/dSzPOsRlQeQdnVO6SYYvQxE
    ...
    -----END PGP MESSAGE-----
    */
  })
} catch(err) {
    console.log('There was an error encrypting', err)
}
 
 

Related

E.nigma - 🔐 e.nigma.pw / Encryption toolbox utility

License

MIT © Jose Aguinaga

Package Sidebar

Install

npm i keybase-encrypt

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • jjperezaguinaga