
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@magiclabs/shamirs-secret-sharing
Advanced tools
A simple implementation of Shamir's Secret Sharing configured to use a finite field in GF(2^8) with 128 bit padding
A simple implementation of Shamir's Secret Sharing configured to use a finite field in GF(2^8) with 128 bit padding.
Much of what you see in this module has been ported from or directly influenced by secrets.js, c-sss, and libgfshare
$ npm install shamirs-secret-sharing
const sss = require('shamirs-secret-sharing')
const secret = Buffer.from('secret key')
const shares = sss.split(secret, { shares: 10, threshold: 4 })
const recovered = sss.combine(shares.slice(3, 7))
console.log(recovered.toString()) // 'secret key'
shares = sss.split(secret, opts)
Generate a set of unique and distinct shares for a secret with a configured threshold.
secret
(required) - A Buffer
instance or string
that represents a
secret for which shares are created foropts
(required) - An object of options for configuring how
shares are created for a secret
opts.shares
(required) - The number of n
shares that should
be created for this secretopts.threshold
(required) - The number of t
of n
distinct share
that are required to reconstruct this secretopts.random
(optional) - An optional Pseudorandom number
generator (PRNG) function that should generate a random value
buffer based on some input. e.g opts.random = (size) => randomBytes(size)
secret = sss.combine(shares)
Reconstruct a secret from a distinct set of shares. This function will
not throw an error for incorrect shares or if p(0)
is not the correct
secret for the given shares.
shares
(required) - An array of shares, that is an array of
equally sized and distinct Buffer
instances, or stringsMIT
FAQs
A simple implementation of Shamir's Secret Sharing configured to use a finite field in GF(2^8) with 128 bit padding
The npm package @magiclabs/shamirs-secret-sharing receives a total of 0 weekly downloads. As such, @magiclabs/shamirs-secret-sharing popularity was classified as not popular.
We found that @magiclabs/shamirs-secret-sharing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 22 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.