Gathering detailed insights and metrics for secretbox-encoding
Gathering detailed insights and metrics for secretbox-encoding
Gathering detailed insights and metrics for secretbox-encoding
Gathering detailed insights and metrics for secretbox-encoding
XSalsa20 Poly1305 codec that implements the abstract-encoding interface.
npm install secretbox-encoding
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
8 Commits
1 Forks
5 Watchers
2 Branches
2 Contributors
Updated on Jan 07, 2020
Latest Version
1.0.0
Package Id
secretbox-encoding@1.0.0
Unpacked Size
12.00 kB
Size
4.03 kB
File Count
7
NPM Version
6.13.4
Node Version
10.17.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
XSalsa20 Poly1305 codec that implements the abstract-encoding interface. Nonces are generated randomly and prepended to the ciphertext.
1$ npm install secretbox-encoding
1const codec = require('secretbox-encoding')(secretKey) 2 3// encode a value 4buffer = codec.encode(value) 5 6// decode a value 7value = codec.decode(buffer)
1const crypto = require('crypto') 2const Codec = require('secretbox-encoding') 3 4const key = crypto.randomBytes(32) 5 6const codec = Codec(key) 7const hello = codec.encode('hello') 8const world = codec.encode('world') 9 10console.log('%s %s', codec.decode(hello), codec.decode(world)) // 'hello world'
1const pbs = require('protocol-buffers') 2const { Message } = pbs(` 3message { 4 string data = 1; 5} 6`) 7 8const codec = Codec(key, { valueEncoding: Message }) 9const encoded = codec.encode({ data: 'hello world' }) 10const message = codec.decode(encoded) // { data: 'hello world' }
codec = require('secretbox-encoding')(secretKey[, opts])
Create a codec object from 32 byte secretKey
.
1const key = crypto.randomBytes(32) 2const codec = Codec(key)
buffer = codec.encode(value[, output[, offset]])
Encode a value using crypto_secretbox_easy into an optional output
buffer at an optional offset
defaulting to 0
. If an output
buffer is not given, one is allocated
for you and returned.
1const buffer = codec.encode('hello world')
value = codec.decode(buffer[, offset])
Decode a buffer using crypto_secretbox_open_easy
at an optional offset
defaulting to 0
.
1const value = codec.decode(buffer)
length = codec.encodingLength(value)
Returns the encoding length for a given value
.
1const length = codec.encodingLength('hello world') // 11
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More