
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
hmac-blake2b
Advanced tools
hmac-blake2b
HMAC based on BLAKE2b
Even though BLAKE2b is designed to also work as a MAC, specifications like Noise call for a HMAC.
var sodium = require('sodium-universal')
var hmac = require('hmac-blake2b')
var mac = Buffer.alloc(hmac.BYTES)
var key = Buffer.alloc(hmac.KEYBYTES)
sodium.randombytes_buf(key)
var data = Buffer.from('some data')
hmac(mac, data, key)
hmac.BYTES
Size of the output MAC in bytes
hmac.KEYBYTES
RFC2104 recommended size of the key in bytes.
hmac(out, data, key)
Computes a HMAC from data
with key
and writes it into out
.
out
must be a Buffer
or Uint8Array
of length hmac.BYTES
data
must be a Buffer
, Uint8Array
or Array
of Buffer
s or
Uint8Array
s.key
must be a Buffer
or Uint8Array
. Per the HMAC spec key
can be as
small as 1 byte, in which case it is right-padded with NUL
bytes, or any
size larger than hmac.KEYBYTES
in which case it is hashed down to fit. The
recommended size by the spec is hmac.KEYBYTES
npm install hmac-blake2b
FAQs
HMAC backed by BLAKE2b
The npm package hmac-blake2b receives a total of 1,125 weekly downloads. As such, hmac-blake2b popularity was classified as popular.
We found that hmac-blake2b demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.