npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

simplepgp

1.2.0 • Public • Published

Module to ease the use of PGP encryption.

Usage:

var simplepgp=require("simplepgp");
var pgp=simplepgp();

Generate pgp keys:

pgp.gen(uid,passphrase,(pubKey,priKey)=>{
    // do whatever with pubKey and priKey
},(err)=>{
    console.log(err);
});

Load pgp keys:

pgp.load.pri(<pgp private key>);
pgp.load.pub(<pgp public key>);

Sign a message:

var message1="Fanboy here ;)";
pgp.sign(message1,(sig)=>{
    // sig is the signed message
},(err)=>{
    console.log(err);
});

Verify signed message:

var sig=<signed message>;
pgp.verify(sig,()=>{
    console.log("Message verified!");
},(err)=>{
    console.log(err)
});

Encrypt a message:

var message1="Encrypt me baby<3 ;)";
pgp.encrypt(message1,(encd)=>{
    // encd is the encrypted message
},(err)=>{
    console.log(err);
});

Thats it, go install and have fun :)

install

npm i simplepgp

Downloadsweekly downloads

2

version

1.2.0

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability