
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
hypercore-encryption
Advanced tools
Dyanmic Hypercore encryption provider
const HypercoreEncryption = require('hypercore-encryption')
async function get (id) {
// get key info corresponding to id...
return {
version, // encryption scheme
padding, // padding byte length
key // block key
}
}
const encryption = new HypercoreEncryption(blindingKey, get, {
preopen: Promise.resolve(1) // optionally pass for initial id
})
const core = new Hypercore(storage, { encryption })
await core.ready()
await core.append('encrypt with key 1')
await encryption.load(99)
await core.append('encrypt with key 99')
const enc = new HypercoreEncryption(blindingKey, getBlockKey, { promise })Instantiate a new encryption provider. Optionally pass a preopen promise that resolves to a key id to be loaded initially.
Provide a hook with the signature:
function getBlockKey (id) {
return {
version, // encryption scheme
padding, // padding byte length
key // block key
}
}
Note: in compat mode, the key info returned at 0 should always be version 0.
await enc.ready()Wait for initial key to load if provided.
enc.paddingThe number of padding bytes used by the current scheme.
enc.seekableBoolean on whether the current scheme allows for seeks.
enc.idThe currently loaded key id.
enc.versionThe version of the currently loaded scheme.
await enc.load(id)Load the key under id and set to be the current encryption info.
await enc.encrypt(index, block, fork)Encrypt a block in place.
await enc.decrypt(index, block)Decrypt a block in place.
HypercoreEncryption.isHypercoreEncryption(enc)Returns a boolean on whether enc is a valid encryption provider.
const blockKey = HypercoreEncryption.getBlockKey(hypercoreKey, encryptionKey)Helper to generate namespaced block keys.
const legacy = HypercoreEncryption.createLegacyProvider(blockKey)Create an encryption provider compatible with Hypercore's legacy encryption scheme.
Apache-2.0
FAQs
Block encryption provider for hypercore
The npm package hypercore-encryption receives a total of 2 weekly downloads. As such, hypercore-encryption popularity was classified as not popular.
We found that hypercore-encryption demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.