2.0.0 ā€¢ Published 7 years ago

keybase-encrypt v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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