@m-onz/cohort-id
v2.0.2
Published
p2p identity crypto utils
Downloads
7
Readme
cohort-id
cohort identity and utils uses: https://www.npmjs.com/package/tweetnacl-blake2b
Create
var Identity = require('@m-onz/cohort-id')
var cohort = Identity()
console.log(cohort.id) // => { secretKey, publicKey }
cohort.hash('hello world!')
Methods
- newEncryptionKey() => generates 32 bit random password
- encrypt ((blob, password) => { box, nonce }
- decrypt (encrypted, nonce, password) => decrypted
- encryptFor (recipient_pk, message) => { box, nonce }
- decryptFrom (public_key, nonce, message) => decrypted
- sign (message) => signature
- verify (publicKey, signature, message) => boolean
- hash (something) => base64 blake2B hash
Install
npm install @m-onz/cohort-id --save