hypercore-xsalsa20-onwrite-hook
A write hook to decrypt data using a xsalsa20 cipher into a Hypercore storage when replicating from peers.
Installation
$ npm install hypercore-xsalsa20-onwrite-hook
Usage
const onwrite =
Example
const replicate = const hypercore = const crypto = const pump = const hook = const ram = const key = crypto const publicKey secretKey = crypto const source = const cipher = const edge = const reader = source
API
const onwrite = hook(nonceStorage, sharedKey)
Creates a onwrite()
hook for a Hypercore feed that uses the
xsalsa20 cipher to encipher or decipher blocks in a Hypercore feed.
Nonces are computed from the Hypercore feed's public key and block
index.
License
MIT