Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
envelope-js
Advanced tools
A javascript tool for cryptographically "boxing" and "unboxing" messages following the envelope spec.
envelope supports encryption to individuals and groups
var { box, unbox, CloakedMsgId } = require('envelope-js')
...
box(plain_text, feed_id, prev_msg_id, msg_key, recp_keys) => ciphertext
where:
plain_text
Buffer is the content to be "enveloped"feed_id
Buffer is a type-format-key (TFK) encoded value for the feed authoring a messageprev_msg_id
Buffer is a TFK encoded value of the id of last message of this feeds chainmsg_key
Buffer a randomised 32 Bytes which will be the unique key for this messagerecps_keys
Array is a collection of items of form { key, scheme }
, where
key
Buffer is the key the particular recipientscheme
String|Buffer is the type of key / the key management scheme for this recipientunbox(ciphertext, feed_id, prev_msg_id, trial_keys, max_attempts) => plain_text | null
where:
ciphertext
Buffer is envelopefeed_id
Buffer is a type-format-key (TFK) encoded value for the feed authoring a messageprev_msg_id
Buffer is a TFK encoded value of the id of last message of this feeds chaintrial_keys
Array is a collection of items of form { key, scheme }
, where
key
Buffer is the key the particular recipientscheme
String|Buffer is the type of key / the key management scheme for this recipientmax_attempts
Integer (default: 8) how many key_slots you want to assume the envelope hasplain_text
Buffer the envelope contentsNOTE: we also expose unboxKey
and unboxBody
for convenience.
DeriveSecret(feed_id, prev_msg_id) => derive
Used for taking a msg_key
(the one-time key for a particular envelope) and deriving other keys used in the envelope (e.g. read_key
)
where:
feed_id
Buffer is a TFK encoded id for the feed the envelope is part ofprev_msg_id
Buffer is a TFK encoded id for the message prior to one where our envelope is
prev_msg_id
's TFK is a zero-filled Buffer.derive(key, labels) => new_key
function where:
key
Buffer is a seed key which we're going to derive fromlabels
Array is a an array of Strings which help define a derivationnew CloakedMsgId(public_msg_id, read_key) => cloakedMsgId
Determine a cloaked message id for a published message following the envelope-spec/cloaked_msg_id/README.md
where:
public_msg_id
Buffer is the id of a enveloped message that's been published (it has an id as it's part of a feed / chain)read_key
Buffer is the read capability (NOT the msg_key
) for this message envelopecloakedMsgId
is an instance with methods:
toBuffer() => Buffer
which returns the cloaked id key as a BuffertoString(encoding) => String
which returns the cloaked id key as a Buffer (encoding defaults to 'base64')mock() => cloakedMsgId
a method for testing. populates the id with random content. if using this, instantiate with no args.slp.encode(info) => Buffer
where info
is an Array of Buffers.
This is "short length-prefixed encoding", see https://github.com/ssbc/envelope-spec/blob/master/encoding/slp.md
...
MIT
FAQs
new private message format for ssb
The npm package envelope-js receives a total of 30 weekly downloads. As such, envelope-js popularity was classified as not popular.
We found that envelope-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.