
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
This module implements the original "private-box" encryption format for SSB. You can use this module as an ssb-db2 plugin, or you can use it as a standalone tool to encrypt and decrypt messages.
npm install ssb-box
YOU MOST LIKELY DON'T NEED TO DO THIS, because ssb-db2 bundles ssb-box already. But maybe one day ssb-db2 won't bundle it anymore, and then you would have to do this.
secret-stack@^6.2.0ssb-db2@>=5.0.0 SecretStack({appKey: require('ssb-caps').shs})
.use(require('ssb-master'))
+ .use(require('ssb-db2'))
+ .use(require('ssb-box'))
.use(require('ssb-conn'))
.use(require('ssb-blobs'))
.call(null, config)
This module conforms with ssb-encryption-format so with ssb-box you can use all the methods specified by ssb-encryption-format.
const ssbKeys = require('ssb-keys');
const boxFormat = require('ssb-box/format');
const keys = ssbKeys.generate('ed25519', 'alice');
const opts = {recps: [keys.id], keys};
const plaintext = Buffer.from('hello');
console.log(plaintext);
// <Buffer 68 65 6c 6c 6f>
const ciphertext = boxFormat.encrypt(plaintext, opts);
console.log(ciphertext);
// <Buffer 9e 60 59 b7 02 a3 c8 74 0f 1e 3c b9 b7 99 80 b4 cb f1 35 a0 48 40 16 d4 fa b9 a6 18 37 f0 cc 1c 37 18 e0 c0 a4 c4 3a 9e 3a 74 6a 89 1f 50 0d 4f 78 6a ... 76 more bytes>
const decrypted = boxFormat.decrypt(ciphertext, opts);
console.log(decrypted);
// <Buffer 68 65 6c 6c 6f>
LGPL-3.0-only
FAQs
The original private-box SSB encryption format, for ssb-db2
We found that ssb-box demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.