abstract-encoding compatible secret key encoder using xchaha20/poly1305 constructs.
npm install crypto-encoder
Example using the crypto-encoder to encrypt the contents of a hypercore.
const ram = require('random-access-memory')
const hypercore = require('hypercore')
const CryptoEncoder = require('crypto-encoder')
const crypto = require('crypto')
const secret = crypto.randomBytes(32)
const feed = hypercore(ram, {
contenEncoding: new CryptoEncoder(secret, 'json')
})
feed.append({ aMessage: 'this entire block will be encrypted' })
Similar projects:
- https://www.npmjs.com/package/xsalsa20-encoding
- https://github.com/little-core-labs/secretbox-encoding#readme
- https://www.npmjs.com/package/crypto-encoder
Ideas and contributions to the project are welcome. You must follow this guideline.
GNU AGPLv3 © Tony Ivanov