paulmillr/noble-hashes is a Security project on GitHub, written primarily in TypeScript. It has 945 stars. Audited & minimal JS implementation of hash functions, MACs and KDFs.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x
🦘 Includes SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF, Scrypt, Argon2
🥈 Wrapper with identical API over native WebCrypto
The library's initial development was funded by Ethereum Foundation.
This library belongs to noble cryptography
noble cryptography — high-security, easily auditable set of contained cryptographic libraries and tools.
Zero or minimal dependencies
Highly readable TypeScript / JS code
PGP-signed releases and transparent NPM builds
All libraries:
ciphers,
curves,
hashes,
post-quantum,
5kb secp256k1 /
ed25519
WASM version: awasm-noble
Check out the homepage
for reading resources, documentation, and apps built with noble
Usage
npm install @noble/hashes
deno add jsr:@noble/hashes
We support all major platforms and runtimes.
For React Native, you may need a polyfill for getRandomValues.
A standalone file noble-hashes.js is also available.
// import * from '@noble/hashes'; // Error: use sub-imports, to ensure small app size
import { sha256 } from '@noble/hashes/sha2.js';
const hash = sha256(Uint8Array.from([0xca, 0xfe, 0x01, 0x23]));
N, r, p are work factors. It is common to only adjust N, while keeping r: 8, p: 1.
See the blog post.
JS doesn't support parallelization, making increasing p meaningless.
dkLen is the length of output bytes e.g. 32 or 64
onProgress can be used with async version of the function to report progress to a user.
maxmem prevents DoS and defaults to 1GiB + 2KiB (2**30 + 2**11), enough for N: 2**20, r: 8, p: 1. It can be adjusted using formula: 128 * r * (N + p + 1)
On Apple M4, N: 2**16 takes 0.1s and 64MB RAM; each increment of N doubles both,
up to N: 2**24 at 27s and 16GB. Mobile phones can be 1x-4x slower.
[!NOTE]
We support N larger than 2**20 where available, however,
not all JS engines support >= 2GB ArrayBuffer-s.
When using such N, you'll need to manually adjust maxmem, using formula above.
Other JS implementations don't support large N-s.
argon2
import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js';
// Defaults to t=3, m=1GiB (specified in KiB), p=1, and a 1GiB maxmem limit.
const arg1 = argon2id('password', 'saltsalt');
[!WARNING]
Argon2 can't be fast in JS, because there is no fast Uint64Array.
It is suggested to use Scrypt instead.
Being 5x slower than native code means brute-forcing attackers have bigger advantage.
Experimental KDF for deriving application-specific child keys from a username + password pair,
built on scrypt, pbkdf2 and hkdf with fixed work factors.
Non-standard: prefer scrypt or argon2 for new designs.
A thin wrapper over built-in crypto.subtle, mirroring the noble-hashes API and validating
inputs, in just 30+ lines of code. Webcrypto methods are always async.
utils
import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils.js';
console.log(toHex(randomBytes(32)));
bytesToHex will convert Uint8Array to a hex string
randomBytes(bytes) will produce cryptographically secure random Uint8Array of length bytes
at version 1.0.0, in Jan 2022, independently, by Cure53
PDFs: website, in-repo
Scope: everything, besides blake3, sha3-addons, sha1 and argon2, which have not been audited
The audit has been funded by Ethereum Foundation with help of Nomic Labs
We've started regular AI-assisted self-audits in Apr 2026.
It is tested against official (ACVP / KAT) vectors, cross-library chained hashing,
sliding-window length sweeps and property-based tests (fast-check),
and is being fuzzed in CI.
If you see anything unusual: investigate and report.
Constant-timeness
We're targetting algorithmic constant time. JIT-compiler and Garbage Collector make "constant time"
extremely hard to achieve timing attack resistance
in a scripting language. Which means any other JS library can't have
constant-timeness. Even statically typed Rust, a language without GC,
makes it harder to achieve constant-time
for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones.
Use low-level libraries & languages.
Memory dumping
The library shares state buffers between hash function calls. Library-owned working buffers are
zeroed after use, including mutable UTF-8 copies created from password-KDF string inputs.
However, if an attacker can read application memory, you are doomed in any case:
JS strings are immutable and can't be overwritten with zeros — e.g. a password passed
to scrypt(password, salt) as a string stays in memory
Inputs & outputs are re-used across the application and stay in file buffers / memory anyway
await anything() writes all internal variables (including numbers) to memory, with no
guarantee of when they get overwritten — plenty of time for an attacker to read them
Supply chain security
Commits are signed with PGP keys to prevent forgery. Be sure to verify the commit signatures
Releases are made transparently through token-less GitHub CI and Trusted Publishing. Be sure to verify the provenance logs for authenticity.
Rare releasing is practiced to minimize the need for re-audits by end-users.
Dependencies are minimized, strictly pinned, and changes are checked with npm-diff.
Dev dependencies are excluded from end-user installs; they’re only used for development and build steps.
For this package, there are 0 dependencies; and a few dev dependencies:
jsbt contains helpers for building, benchmarking & testing secure JS apps. It is developed by the same author
prettier, fast-check and typescript are used for code quality / test generation / ts compilation
Randomness
We rely on the built-in
crypto.getRandomValues,
which is considered a cryptographically secure PRNG.
Browsers have had weaknesses in the past - and could again - but implementing a userspace CSPRNG is even worse, as there’s no reliable userspace source of high-quality entropy.
Quantum computers
Cryptographically relevant quantum computer, if built, will allow to
utilize Grover's algorithm to break hashes in 2^n/2 operations, instead of 2^n.
This means SHA256 should be replaced with SHA512, SHA3-256 with SHA3-512, SHAKE128 with SHAKE256 etc.
Australian ASD prohibits SHA256 and similar hashes after 2030.
Upgrading
Supported node.js versions:
v2: v20.19+ (ESM-only)
v1: v14.21+ (ESM & CJS)
v2.0 changelog:
The package is now ESM-only. ESM can finally be loaded from common.js on node v20.19+
.js extension must be used for all modules
Old: @noble/hashes/sha3
New: @noble/hashes/sha3.js
This simplifies working in browsers natively without transpilers
Only allow Uint8Array as hash inputs, prohibit string
Strict validation checks improve security
To replicate previous behavior, use utils.utf8ToBytes
Rename / remove some modules for consistency. Previously, sha384 resided in sha512, which was weird
sha256, sha512 => sha2.js (consistent with sha3.js)
blake2b, blake2s => blake2.js (consistent with blake3.js, blake1.js)
ripemd160, sha1, md5 => legacy.js (all low-security hashes are there)
_assert => utils.js
crypto internal module got removed: use built-in WebCrypto instead
Improve typescript types & option autocomplete
Bump compilation target from es2020 to es2022
Contributing & testing
npm install && npm run build && npm test will build the code and run tests.
There are additional slow suites: timing-based DoS tests npm run test:dos,
multi-hour large-input tests npm run test:slow, ACVP LDT vectors npm run test:acvp,
and memory-intensive KDF tests npm run test:ultra. The 9–17GiB scrypt cases require an
explicitly provisioned machine and run separately with npm run test:ultra:scrypt.
See paulmillr.com/noble for useful resources, articles, documentation and demos related to the library.
Speed
npm run benchmark
Benchmarks measured on Apple M4.
The library could be 3x faster by utilizing loop unrolling. It isn't used because
unrolling a) would increase bundle size b) make lib un-readable c) current perf is "fast enough"
for most use-cases.
If you need truly exemplar performance, switch to awasm-noble,
which does unrolling in an auditable way and allows to achieve 10GB/s BLAKE3.
# 32B
sha256 438 ns
sha512 1219 ns
sha3_256 1853 ns
sha3_512 1864 ns
kt128 1380 ns
kt256 1370 ns
turboshake128 1191 ns
blake256 1335 ns
blake2b 2186 ns
blake2s 1055 ns
blake3 981 ns
ripemd160 563 ns
md5 449 ns
sha1 507 ns
hmac(sha256) 1955 ns
hmac(sha512) 5126 ns
kmac256 6653 ns
blake3(key) 1120 ns
# 1MB
sha256 x 297 mib/sec
sha512 x 130 mib/sec
sha3_256 x 78.1 mib/sec
sha3_512 x 41.9 mib/sec
kt128 x 184 mib/sec
kt256 x 147 mib/sec
turboshake128 x 186 mib/sec
blake256 x 56.7 mib/sec
blake2b x 66.2 mib/sec
blake2s x 62.9 mib/sec
blake3 x 90 mib/sec
ripemd160 x 179 mib/sec
md5 x 275 mib/sec
sha1 x 417 mib/sec
hmac(sha256) x 290 mib/sec
hmac(sha512) x 129 mib/sec
kmac256 x 78.4 mib/sec
blake3(key) x 90.5 mib/sec
# KDF
hkdf(sha256) x 249,100 ops/sec @ 4015 ns/op
blake3(context) x 480,400 ops/sec @ 2081 ns/op
pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 199 ms/op
scrypt(n: 2 ** 19, r: 8, p: 1) x 1 ops/sec @ 751 ms/op
argon2id(t: 1, m: 128MB) x 3 ops/sec @ 276 ms/op
License
The MIT License (MIT)
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
Yes — paulmillr/noble-hashes ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/paulmillr/noble-hashes.
What else is in the Security space?
paulmillr/noble-hashes is tracked by TopGit under the Security category, alongside 19 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is paulmillr/noble-hashes?
paulmillr/noble-hashes (paulmillr/noble-hashes) is a TypeScript project on GitHub. From the project's own README: Audited & minimal JS implementation of hash functions, MACs and KDFs.
What license does paulmillr/noble-hashes use?
paulmillr/noble-hashes is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see paulmillr/noble-hashes in action?
The project maintains a homepage at https://paulmillr.com/noble. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about paulmillr/noble-hashes?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/paulmillr/noble-hashes is the definitive source.
Why is paulmillr/noble-hashes categorized under Security?
TopGit places paulmillr/noble-hashes in the Security category based on its GitHub topics and description (tagged: "argon2", "blake2", "blake3"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Is noble-hashes worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of noble-hashes.