Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
hypercore-xsalsa20-onwrite-hook
Advanced tools
A write hook to decrypt data using a XSalsa20 cipher into a hypercore storage when replicating from peers
A write hook to decrypt data using a xsalsa20 cipher into a Hypercore storage when replicating from peers.
$ npm install hypercore-xsalsa20-onwrite-hook
const onwrite = hook(sharedSecret)
const replicate = require('hypercore-replicate')
const hypercore = require('hypercore')
const crypto = require('hypercore-crypto')
const pump = require('pump')
const hook = require('hypercore-xsalsa20-onwrite-hook')
const ram = require('random-access-memory')
const key = crypto.randomBytes(32)
const { publicKey, secretKey } = crypto.keyPair()
const source = hypercore(ram, publicKey, {
secretKey,
})
const cipher = hypercore(ram, publicKey, {
secretKey,
onwrite: hook(key)
})
const edge = hypercore(ram, publicKey)
const reader = hypercore(ram, publicKey, {
onwrite: hook(key)
})
source.append(Buffer.from('hello'), (err) => {
source.head(console.log) // plaintext
// load cipher hypercore
pump(source.createReadStream(), cipher.createWriteStream(), (err) => {
if (err) throw err
cipher.head(console.log) // ciphertext
replicate(cipher, edge, (err) => {
if (err) throw err
edge.head(console.log) // ciphertext
replicate(edge, reader, (err) => {
if (err) throw err
reader.head(console.log) // plaintext
})
})
})
})
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.
MIT
FAQs
A write hook to decrypt data using a XSalsa20 cipher into a hypercore storage when replicating from peers
The npm package hypercore-xsalsa20-onwrite-hook receives a total of 0 weekly downloads. As such, hypercore-xsalsa20-onwrite-hook popularity was classified as not popular.
We found that hypercore-xsalsa20-onwrite-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.