Gathering detailed insights and metrics for sodium-up
Gathering detailed insights and metrics for sodium-up
npm install sodium-up
Typescript
Module System
Node Version
NPM Version
61.5
Supply Chain
98.3
Quality
74.9
Maintenance
100
Vulnerability
98.2
License
JavaScript (100%)
Total Downloads
1,681
Last Day
2
Last Week
5
Last Month
10
Last Year
154
2 Stars
13 Commits
2 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.4.0
Package Id
sodium-up@0.4.0
Size
5.59 kB
NPM Version
4.2.0
Node Version
7.9.0
Cumulative downloads
Total Downloads
Last day
100%
2
Compared to previous day
Last week
25%
5
Compared to previous week
Last month
42.9%
10
Compared to previous month
Last year
31.6%
154
Compared to previous year
1
2
sodium-up
Convenience wrapper around
sodium-universal
1var sodium = require('sodium-up') 2 3var random = sodium.randombytes_buf(Buffer.allocUnsafe(16))
WIP
See sodium-native
for complete documentation.
sodium.randombytes_*
var output = sodium.randombytes_buf(output)
output
can either be a Buffer or integer length. Will return output
sodium.crypto_sign_*
Constants:
sodium.crypto_sign_SEEDBYTES
sodium.crypto_sign_PUBLICKEYBYTES
sodium.crypto_sign_SECRETKEYBYTES
sodium.crypto_sign_BYTES
var {publicKey, secretKey} = crypto_sign_seed_keypair([publicKey, secretKey], seed)
publicKey
and secretKey
are optional, but can be Buffer or integer length.
Defaults to Buffer of sodium.crypto_sign_PUBLICKEYBYTES
and sodium.crypto_sign_SECRETKEYBYTES
length.
Will return and object with {publicKey, secretKey}
var {publicKey, secretKey} = crypto_sign_keypair([publicKey, secretKey])
publicKey
and secretKey
are optional, but can be Buffer or integer length.
Defaults to Buffer of sodium.crypto_sign_PUBLICKEYBYTES
and sodium.crypto_sign_SECRETKEYBYTES
length.
Will return and object with {publicKey, secretKey}
var signedMessage = crypto_sign([signedMessage], message, secretKey)
signedMessage
is optional, but can be Buffer or integer length. Defaults to Buffer of sodium.crypto_sign_BYTES
length.
Will return signedMessage
var boolOrBuf = crypto_sign_open([message], signedMessage, publicKey)
message
is optional, but can be Buffer or integer length. Defaults to Buffer of signedMessage.length - sodium.crypto_sign_BYTES
length.
Will return false
if the signature is invalid or message
otherwise
var signature = crypto_sign_detached([signature], message, secretKey)
signature
is optional, but can be Buffer or integer length. Defaults to Buffer of sodium.crypto_sign_BYTES
length.
Will return signature
var bool = crypto_sign_verify_detached(signature, message, publicKey)
Alias to sodium-native#crypto_sign_verify_detached
sodium.crypto_generichash_*
Constants:
sodium.crypto_generichash_PRIMITIVE
sodium.crypto_generichash_BYTES_MIN
sodium.crypto_generichash_BYTES_MAX
sodium.crypto_generichash_BYTES
sodium.crypto_generichash_KEYBYTES_MIN
sodium.crypto_generichash_KEYBYTES_MAX
sodium.crypto_generichash_KEYBYTES
var output = crypto_generichash([output], input, [key])
output
is optional, but can be Buffer or integer length. Defaults to Buffer of sodium.crypto_generichash_BYTES
length. Will return output
Examples of input permutations:
1sodium.crypto_generichash(input)
2sodium.crypto_generichash(input, key)
3sodium.crypto_generichash(output, input, null)
4sodium.crypto_generichash(null, input, key)
5sodium.crypto_generichash(null, input, null)
var instance = crypto_generichash_instance([key], [outputLength])
sodium-native#crypto_generichash_instance
wrapped in an object so .update()
and .final()
can be overridden.
var instance = instance.update(input)
Will return instance
for easy chaining
var output = instance.final([output])
output
is optional, but can be Buffer of outputLength
or longer. Defaults to Buffer of outputLength
length. Will return output
sodium.crypto_pwhash_*
Constants:
sodium.crypto_pwhash_ALG_DEFAULT
sodium.crypto_pwhash_BYTES_MIN
sodium.crypto_pwhash_BYTES_MAX
sodium.crypto_pwhash_PASSWD_MIN
sodium.crypto_pwhash_PASSWD_MAX
sodium.crypto_pwhash_SALTBYTES
sodium.crypto_pwhash_STRBYTES
sodium.crypto_pwhash_STRPREFIX
sodium.crypto_pwhash_OPSLIMIT_MIN
sodium.crypto_pwhash_OPSLIMIT_MAX
sodium.crypto_pwhash_MEMLIMIT_MIN
sodium.crypto_pwhash_MEMLIMIT_MAX
sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE
sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE
sodium.crypto_pwhash_OPSLIMIT_MODERATE
sodium.crypto_pwhash_MEMLIMIT_MODERATE
sodium.crypto_pwhash_OPSLIMIT_SENSITIVE
sodium.crypto_pwhash_MEMLIMIT_SENSITIVE
sodium.crypto_pwhash_PRIMITIVE
var output = sodium.crypto_pwhash([output], password, salt, opslimit, memlimit, algorithm)
output
can either be a Buffer or integer length. Will return output
var output = sodium.crypto_pwhash_str([output], password, opslimit, memlimit)
output
is optional, but can be Buffer or integer length. Defaults to Buffer of sodium.crypto_pwhash_STRBYTES
length. Will return output
var bool = sodium.crypto_pwhash_str_verify(str, password)
Alias to sodium-native#crypto_pwhash_str_verify
1npm install sodium-up
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-13
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