
Security News
Federal Government Rescinds Software Supply Chain Mandates, Makes SBOMs Optional
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.
hypercore-encryption
Advanced tools
Dyanmic Hypercore encryption provider
const HypercoreEncryption = require('hypercore-encryption')
const getEncryptionKey = async (id) => {
// get key info corresponding to id...
return {
id, // encryption scheme
encryptionKey // encryption key
}
}
const encryption = new HypercoreEncryption(getEncryptionKey)
const core = new Hypercore(storage, {
encryption: encryption.createEncryptionProvider({
transform (ctx, entropy, compat) {
return {
block: deriveBlockKey(entropy),
hash: deriveHashKey(entropy)
}
}
})
})
await core.ready()
await core.append('encrypt with key')
const enc = new HypercoreEncryption(getEncryptionKey)Instantiate a new encryption provider.
Takes a hook with the signature:
async function getEncryptionKey (id) {
// if id is passed as -1, the module expects the latest key
return {
id, // encryption id
encryptionKey // encryption key
}
}
const provider = enc.createEncryptionProvider({ transform, compat })Create an encryption provider.
{
function transform (ctx, entropy, compat) {
// implement custom block key derivation
// compat will be passed as true when a compat is expected
// block key and hash/blinding key should be distinct
return {
block,
hash, // not required for compat keys
blinding // only required for compat keys
}
},
function compat (ctx, index) {
// return true or false whether a compat key is expected
}
}
See hypercore encryption for details on compat encryption.
enc.clear()Clear any cached keys.
const { id, encryptionKey } = await enc.get(id)Fetch the encryption key at id.
If -1 is passed as id, the latest available key will be returned.
Apache-2.0
FAQs
Block encryption provider for hypercore
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
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.