
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.