
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Cryptographic hash functions.
SHA-224, SHA-256, SHA-384, and SHA-512.
import { sha256 } from "@libn/hash/sha2";
import { assertEquals } from "@std/assert";
const data = crypto.getRandomValues(new Uint8Array(100));
assertEquals(sha256(data).buffer, await crypto.subtle.digest("SHA-256", data));
HMAC-SHA256 and HKDF-SHA256.
import { hkdf, hmac } from "@libn/hash/hmac";
import { assertEquals } from "@std/assert";
const key = crypto.getRandomValues(new Uint8Array(32));
const data = crypto.getRandomValues(new Uint8Array(100));
assertEquals(
hmac(key, data).buffer,
await crypto.subtle.sign(
"HMAC",
await crypto.subtle.importKey(
"raw",
key,
{ name: "HMAC", hash: "SHA-256" },
false,
["sign"],
),
data,
),
);
assertEquals(
hkdf(key).buffer,
await crypto.subtle.deriveBits(
{
name: "HKDF",
hash: "SHA-256",
info: new Uint8Array(),
salt: new Uint8Array(),
},
await crypto.subtle.importKey("raw", key, "HKDF", false, ["deriveBits"]),
256,
),
);
import { blake2b, blake2s } from "@libn/hash/blake2";
import { assertEquals } from "@std/assert";
import { crypto } from "@std/crypto";
const data = crypto.getRandomValues(new Uint8Array(100));
assertEquals(blake2s(data).buffer, await crypto.subtle.digest("BLAKE2S", data));
assertEquals(blake2b(data).buffer, await crypto.subtle.digest("BLAKE2B", data));
BLAKE3 hashing, keyed hashing, and key derivation.
import { blake3 } from "@libn/hash/blake3";
import { assertEquals, assertNotEquals } from "@std/assert";
import { crypto } from "@std/crypto";
const data = crypto.getRandomValues(new Uint8Array(100));
const key1 = crypto.getRandomValues(new Uint8Array(32));
const key2 = crypto.getRandomValues(new Uint8Array(32));
// Mode `hash`
assertEquals(blake3(data).buffer, await crypto.subtle.digest("BLAKE3", data));
// Mode `keyed_hash`
assertNotEquals(blake3(data, key1, 512), blake3(data, key2, 512));
// Mode `derive_key`
assertNotEquals(blake3(key1), blake3(key2));
assertNotEquals(blake3(key1, "context 1"), blake3(key1, "context 2"));
FAQs
Cryptographic hash functions.
We found that @libn/hash demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.