Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
blake2b-wasm
Advanced tools
Blake2b implemented in WASM
npm install blake2b-wasm
Works in browsers that support WASM and Node.js 8+.
var blake2b = require('blake2b-wasm')
if (!blake2b.SUPPORTED) {
console.log('WebAssembly not supported by your runtime')
}
blake2b.ready(function (err) {
if (err) throw err
var hash = blake2b()
.update(Buffer.from('hello')) // pass in a buffer or uint8array
.update(Buffer.from(' '))
.update(Buffer.from('world'))
.digest('hex')
console.log('Blake2b hash of "hello world" is %s', hash)
})
var hash = blake2b([digestLength], [key], [salt], [personal])
Create a new hash instance. digestLength
defaults to 32
.
hash.update(data)
Update the hash with a new piece of data. data
should be a buffer or uint8array.
var digest = hash.digest([enc])
Digest the hash.
hash.getPartialHash()
Returns the current partial hash.
hash.setPartialHash(data)
Set the hash to a previously set hash. data
should be the result of getPartialHash()
(which returns uint8array)
var promise = blake2b.ready([cb])
Wait for the WASM code to load. Returns the WebAssembly instance promise as well for convenience. You have to call this at least once before instantiating the hash.
There is a browser example included in example.html and example.js.
The bulk of this module is implemented in WebAssembly in the blake2b.wat file. To build the thin Javascript wrapper do:
npm run compile
MIT
FAQs
Blake2b implemented in WASM
The npm package blake2b-wasm receives a total of 31,042 weekly downloads. As such, blake2b-wasm popularity was classified as popular.
We found that blake2b-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.