• Stars
    star
    468
  • Rank 90,735 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Audited & minimal JS implementation of hash functions, MACs and KDFs.

noble-hashes

Audited & minimal JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2 & Scrypt.

  • 🔒 Audited by an independent security firm
  • ðŸ”ŧ Tree-shaking-friendly: use only what's necessary, other code won't be included
  • 🏎 Ultra-fast, hand-optimized for caveats of JS engines
  • 🔍 Unique tests ensure correctness: chained tests, sliding window tests, DoS tests, fuzzing
  • 🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x
  • ðŸĒ Scrypt supports N: 2**22, while other implementations are limited to 2**20
  • ðŸĶ˜ SHA3 supports Keccak, TupleHash, KangarooTwelve and MarsupilamiFourteen
  • ðŸŠķ Just 3.4k lines / 17KB gzipped. SHA256-only is 240 lines / 3KB gzipped

The library's initial development was funded by Ethereum Foundation.

This library belongs to noble crypto

noble-crypto — high-security, easily auditable set of contained cryptographic libraries and tools.

  • No dependencies, protection against supply chain attacks
  • Auditable TypeScript / JS code
  • Supported in all major browsers and stable node.js versions
  • All releases are signed with PGP keys
  • Check out homepage & all libraries: curves (4kb versions secp256k1, ed25519), hashes

Usage

npm install @noble/hashes

We support all major platforms and runtimes. For Deno, ensure to use npm specifier. For React Native, you may need a polyfill for getRandomValues. If you don't like NPM, a standalone noble-hashes.js is also available.

The library is tree-shaking-friendly and does not expose root entry point as @noble/hashes. Instead, you need to import specific primitives. This is done to ensure small size of your apps.

import { sha256 } from '@noble/hashes/sha256'; // ECMAScript modules (ESM) and Common.js
// import { sha256 } from 'npm:@noble/[email protected]/sha256'; // Deno
console.log(sha256(new Uint8Array([1, 2, 3]))); // Uint8Array(32) [3, 144, 88, 198, 242...]
// you could also pass strings that will be UTF8-encoded to Uint8Array
console.log(sha256('abc')); // == sha256(new TextEncoder().encode('abc'))

// sha384 is here, because it uses same internals as sha512
import { sha512, sha512_256, sha384 } from '@noble/hashes/sha512';
// prettier-ignore
import {
  sha3_224, sha3_256, sha3_384, sha3_512,
  keccak_224, keccak_256, keccak_384, keccak_512,
  shake128, shake256
} from '@noble/hashes/sha3';
// prettier-ignore
import {
  cshake128, cshake256, kmac128, kmac256,
  k12, m14,
  tuplehash256, parallelhash256, keccakprg
} from '@noble/hashes/sha3-addons';
import { ripemd160 } from '@noble/hashes/ripemd160';
import { blake3 } from '@noble/hashes/blake3';
import { blake2b } from '@noble/hashes/blake2b';
import { blake2s } from '@noble/hashes/blake2s';
import { hmac } from '@noble/hashes/hmac';
import { hkdf } from '@noble/hashes/hkdf';
import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2';
import { scrypt, scryptAsync } from '@noble/hashes/scrypt';

import { sha1 } from '@noble/hashes/sha1'; // legacy

// small utility method that converts bytes to hex
import { bytesToHex as toHex } from '@noble/hashes/utils';
console.log(toHex(sha256('abc'))); // ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

API

All hash functions:

  • can be called directly, with Uint8Array.
  • return Uint8Array
  • can receive string, which is automatically converted to Uint8Array via utf8 encoding (not hex)
  • support hashing 4GB of data per update on 64-bit systems (unlimited with streaming)
function hash(message: Uint8Array | string): Uint8Array;
hash(new Uint8Array([1, 3]));
hash('string') == hash(new TextEncoder().encode('string'));

All hash functions can be constructed via hash.create() method:

  • the result is Hash subclass instance, which has update() and digest() methods
  • digest() finalizes the hash and makes it no longer usable
hash
  .create()
  .update(new Uint8Array([1, 3]))
  .digest();

Some hash functions can also receive options object, which can be either passed as a:

  • second argument to hash function: blake3('abc', { key: 'd', dkLen: 32 })
  • first argument to class initializer: blake3.create({ context: 'e', dkLen: 32 })

Modules

SHA2 (sha256, sha384, sha512, sha512_256)
import { sha256 } from '@noble/hashes/sha256';
const h1a = sha256('abc');
const h1b = sha256
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();
import { sha512 } from '@noble/hashes/sha512';
const h2a = sha512('abc');
const h2b = sha512
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();

// SHA512/256 variant
import { sha512_256 } from '@noble/hashes/sha512';
const h3a = sha512_256('abc');
const h3b = sha512_256
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();

// SHA384
import { sha384 } from '@noble/hashes/sha512';
const h4a = sha384('abc');
const h4b = sha384
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();

See RFC 4634 and the paper on SHA512/256.

SHA3 (FIPS, SHAKE, Keccak)
import {
  sha3_224,
  sha3_256,
  sha3_384,
  sha3_512,
  keccak_224,
  keccak_256,
  keccak_384,
  keccak_512,
  shake128,
  shake256,
} from '@noble/hashes/sha3';
const h5a = sha3_256('abc');
const h5b = sha3_256
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();
const h6a = keccak_256('abc');
const h7a = shake128('abc', { dkLen: 512 });
const h7b = shake256('abc', { dkLen: 512 });

See FIPS PUB 202, Website.

Check out the differences between SHA-3 and Keccak

SHA3 Addons (cSHAKE, KMAC, TupleHash, ParallelHash, KangarooTwelve, MarsupilamiFourteen)
import {
  cshake128,
  cshake256,
  kmac128,
  kmac256,
  k12,
  m14,
  tuplehash128,
  tuplehash256,
  parallelhash128,
  parallelhash256,
  keccakprg,
} from '@noble/hashes/sha3-addons';
const h7c = cshake128('abc', { personalization: 'def' });
const h7d = cshake256('abc', { personalization: 'def' });
const h7e = kmac128('key', 'message');
const h7f = kmac256('key', 'message');
const h7h = k12('abc');
const h7g = m14('abc');
const h7i = tuplehash128(['ab', 'c']); // tuplehash(['ab', 'c']) !== tuplehash(['a', 'bc']) !== tuplehash(['abc'])
// Same as k12/blake3, but without reduced number of rounds. Doesn't speedup anything due lack of SIMD and threading,
// added for compatibility.
const h7j = parallelhash128('abc', { blockLen: 8 });
// pseudo-random generator, first argument is capacity. XKCP recommends 254 bits capacity for 128-bit security strength.
// * with a capacity of 254 bits.
const p = keccakprg(254);
p.feed('test');
const rand1b = p.fetch(1);
  • Full NIST SP 800-185: cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants
  • ðŸĶ˜ K12 (KangarooTwelve Paper, RFC Draft) and M14 aka MarsupilamiFourteen are basically parallel versions of Keccak with reduced number of rounds (same as Blake3 and ParallelHash).
  • KeccakPRG: Pseudo-random generator based on Keccak
RIPEMD-160
import { ripemd160 } from '@noble/hashes/ripemd160';
// function ripemd160(data: Uint8Array): Uint8Array;
const hash8 = ripemd160('abc');
const hash9 = ripemd160()
  .create()
  .update(Uint8Array.from([1, 2, 3]))
  .digest();

See RFC 2286, Website

BLAKE2b, BLAKE2s
import { blake2b } from '@noble/hashes/blake2b';
import { blake2s } from '@noble/hashes/blake2s';
const h10a = blake2s('abc');
const b2params = { key: new Uint8Array([1]), personalization: t, salt: t, dkLen: 32 };
const h10b = blake2s('abc', b2params);
const h10c = blake2s
  .create(b2params)
  .update(Uint8Array.from([1, 2, 3]))
  .digest();

See RFC 7693, Website.

BLAKE3
import { blake3 } from '@noble/hashes/blake3';
// All params are optional
const h11 = blake3('abc', { dkLen: 256, key: 'def', context: 'fji' });
SHA1 (legacy)

SHA1 was cryptographically broken, however, it was not broken for cases like HMAC.

See RFC4226 B.2.

Don't use it for a new protocol.

import { sha1 } from '@noble/hashes/sha1';
const h12 = sha1('def');
HMAC
import { hmac } from '@noble/hashes/hmac';
import { sha256 } from '@noble/hashes/sha256';
const mac1 = hmac(sha256, 'key', 'message');
const mac2 = hmac.create(sha256, Uint8Array.from([1, 2, 3])).update(Uint8Array.from([4, 5, 6])).digest();

Matches RFC 2104.

HKDF
import { hkdf } from '@noble/hashes/hkdf';
import { sha256 } from '@noble/hashes/sha256';
import { randomBytes } from '@noble/hashes/utils';
const inputKey = randomBytes(32);
const salt = randomBytes(32);
const info = 'abc';
const dkLen = 32;
const hk1 = hkdf(sha256, inputKey, salt, info, dkLen);

// == same as
import * as hkdf from '@noble/hashes/hkdf';
import { sha256 } from '@noble/hashes/sha256';
const prk = hkdf.extract(sha256, inputKey, salt);
const hk2 = hkdf.expand(sha256, prk, info, dkLen);

Matches RFC 5869.

PBKDF2
import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2';
import { sha256 } from '@noble/hashes/sha256';
const pbkey1 = pbkdf2(sha256, 'password', 'salt', { c: 32, dkLen: 32 });
const pbkey2 = await pbkdf2Async(sha256, 'password', 'salt', { c: 32, dkLen: 32 });
const pbkey3 = await pbkdf2Async(sha256, Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), {
  c: 32,
  dkLen: 32,
});

Matches RFC 2898.

Scrypt
import { scrypt, scryptAsync } from '@noble/hashes/scrypt';
const scr1 = scrypt('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 });
const scr2 = await scryptAsync('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 });
const scr3 = await scryptAsync(Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), {
  N: 2 ** 22,
  r: 8,
  p: 1,
  dkLen: 32,
  onProgress(percentage) {
    console.log('progress', percentage);
  },
  maxmem: 2 ** 32 + 128 * 8 * 1, // N * r * p * 128 + (128*r*p)
});

Conforms to RFC 7914, Website

  • N, r, p are work factors. To understand them, see the blog post.
  • dkLen is the length of output bytes
  • It is common to use N from 2**10 to 2**22 and {r: 8, p: 1, dkLen: 32}
  • onProgress can be used with async version of the function to report progress to a user.

Memory usage of scrypt is calculated with the formula N * r * p * 128 + (128 * r * p), which means {N: 2 ** 22, r: 8, p: 1} will use 4GB + 1KB of memory. To prevent DoS, we limit scrypt to 1GB + 1KB of RAM used, which corresponds to {N: 2 ** 20, r: 8, p: 1}. If you want to use higher values, increase maxmem using the formula above.

Note: noble supports 2**22 (4GB RAM) which is the highest amount amongst JS libs. Many other implementations don't support it. We cannot support 2**23, because there is a limitation in JS engines that makes allocating arrays bigger than 4GB impossible, but we're looking into other possible solutions.

Argon2

Experimental Argon2 RFC 9106 implementation. It may be removed at any time.

import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2';
const result = argon2id('password', 'salt', { t: 2, m: 65536, p: 1 });
ESKDF

A tiny stretched KDF for various applications like AES key-gen. Takes >= 2 seconds to execute.

Takes following params:

  • username - username, email, or identifier, min: 8 characters, should have enough entropy
  • password - min: 8 characters, should have enough entropy

Produces ESKDF instance that has deriveChildKey(protocol, accountId[, options]) function.

  • protocol - 3-15 character protocol name
  • accountId - numeric identifier of account
  • options - keyLength: 32 with specified key length (default is 32), or modulus: 2n ** 221n - 17n with specified modulus. It will fetch modulus + 64 bits of data, execute modular division. The result will have negligible bias as per FIPS 186 B.4.1. Can be used to generate, for example, elliptic curve keys.

Takes username and password, then takes protocol name and account id.

import { eskdf } from '@noble/hashes/eskdf';
const kdf = await eskdf('example@university', 'beginning-new-example');
console.log(kdf.fingerprint);
const key1 = kdf.deriveChildKey('aes', 0);
const key2 = kdf.deriveChildKey('aes', 0, { keyLength: 16 });
const ecc1 = kdf.deriveChildKey('ecc', 0, { modulus: 2n ** 252n - 27742317777372353535851937790883648493n })
kdf.expire();
utils
import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils';
console.log(toHex(randomBytes(32)));
  • bytesToHex will convert Uint8Array to a hex string
  • randomBytes(bytes) will produce cryptographically secure random Uint8Array of length bytes

Security

Noble is production-ready.

  1. The library has been audited in Jan 2022 by an independent security firm cure53: PDF. No vulnerabilities have been found. The audit has been funded by Ethereum Foundation with help of Nomic Labs. Modules blake3, sha3-addons, sha1 and argon2 have not been audited. See changes since audit.
  2. The library has been fuzzed by Guido Vranken's cryptofuzz. You can run the fuzzer by yourself to check it.
  3. Timing attack considerations: JIT-compiler and Garbage Collector make "constant time" extremely hard to achieve 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. Nonetheless we're targetting algorithmic constant time.
  4. Memory dump considerations: the library shares state buffers between hash function calls. The buffers are zeroed-out after each call. However, if an attacker can read application memory, you are doomed in any case:
    • At some point, input will be a string and strings are immutable in JS: there is no way to overwrite them with zeros. For example: deriving key from scrypt(password, salt) where password and salt are strings
    • Input from a file will stay in file buffers
    • Input / output will be re-used multiple times in application which means it could stay in memory
    • await anything() will always write all internal variables (including numbers) to memory. With async functions / Promises there are no guarantees when the code chunk would be executed. Which means attacker can have plenty of time to read data from memory
    • There is no way to guarantee anything about zeroing sensitive data without complex tests-suite which will dump process memory and verify that there is no sensitive data left. For JS it means testing all browsers (incl. mobile), which is complex. And of course it will be useless without using the same test-suite in the actual application that consumes the library

We consider infrastructure attacks like rogue NPM modules very important; that's why it's crucial to minimize the amount of 3rd-party dependencies & native bindings. If your app uses 500 dependencies, any dep could get hacked and you'll be downloading malware with every npm install. Our goal is to minimize this attack vector.

Speed

Benchmarks measured on Apple M1 with macOS 12. Note that PBKDF2 and Scrypt are tested with extremely high work factor. To run benchmarks, execute npm run bench:install and then npm run bench

SHA256 32B x 1,219,512 ops/sec @ 820ns/op Âą 2.58% (min: 625ns, max: 4ms)
SHA384 32B x 512,032 ops/sec @ 1Ξs/op
SHA512 32B x 509,943 ops/sec @ 1Ξs/op
SHA3-256, keccak256, shake256 32B x 199,600 ops/sec @ 5Ξs/op
Kangaroo12 32B x 336,360 ops/sec @ 2Ξs/op
Marsupilami14 32B x 298,418 ops/sec @ 3Ξs/op
BLAKE2b 32B x 379,794 ops/sec @ 2Ξs/op
BLAKE2s 32B x 515,995 ops/sec @ 1Ξs/op ¹ 1.07% (min: 1Ξs, max: 4ms)
BLAKE3 32B x 588,235 ops/sec @ 1Ξs/op ¹ 1.36% (min: 1Ξs, max: 5ms)
RIPEMD160 32B x 1,140,250 ops/sec @ 877ns/op Âą 3.12% (min: 708ns, max: 6ms)
HMAC-SHA256 32B x 377,358 ops/sec @ 2Ξs/op

HKDF-SHA256 32B x 108,377 ops/sec @ 9Ξs/op
PBKDF2-HMAC-SHA256 262144 x 3 ops/sec @ 326ms/op
PBKDF2-HMAC-SHA512 262144 x 1 ops/sec @ 970ms/op
Scrypt r: 8, p: 1, n: 262144 x 1 ops/sec @ 616ms/op

Compare to native node.js implementation that uses C bindings instead of pure-js code:

SHA256 32B node x 1,302,083 ops/sec @ 768ns/op Âą 10.54% (min: 416ns, max: 7ms)
SHA384 32B node x 975,609 ops/sec @ 1Ξs/op ¹ 11.32% (min: 625ns, max: 8ms)
SHA512 32B node x 983,284 ops/sec @ 1Ξs/op ¹ 11.24% (min: 625ns, max: 8ms)
SHA3-256 32B node x 910,746 ops/sec @ 1Ξs/op ¹ 12.19% (min: 666ns, max: 10ms)
keccak, k12, m14 are not implemented
BLAKE2b 32B node x 967,117 ops/sec @ 1Ξs/op ¹ 11.26% (min: 625ns, max: 9ms)
BLAKE2s 32B node x 1,055,966 ops/sec @ 947ns/op Âą 11.07% (min: 583ns, max: 7ms)
BLAKE3 is not implemented
RIPEMD160 32B node x 1,002,004 ops/sec @ 998ns/op Âą 10.66% (min: 625ns, max: 7ms)
HMAC-SHA256 32B node x 919,963 ops/sec @ 1Ξs/op ¹ 6.13% (min: 833ns, max: 5ms)
HKDF-SHA256 32 node x 369,276 ops/sec @ 2Ξs/op ¹ 13.59% (min: 1Ξs, max: 9ms)
PBKDF2-HMAC-SHA256 262144 node x 25 ops/sec @ 39ms/op
PBKDF2-HMAC-SHA512 262144 node x 7 ops/sec @ 132ms/op
Scrypt r: 8, p: 1, n: 262144 node x 1 ops/sec @ 523ms/op

It is possible to make this library 4x+ faster by doing code generation of full loop unrolls. We've decided against it. Reasons:

  • the library must be auditable, with minimum amount of code, and zero dependencies
  • most method invocations with the lib are going to be something like hashing 32b to 64kb of data
  • hashing big inputs is 10x faster with low-level languages, which means you should probably pick 'em instead

The current performance is good enough when compared to other projects; SHA256 takes only 900 nanoseconds to run.

Contributing & testing

  1. Clone the repository
  2. npm install to install build dependencies like TypeScript
  3. npm run build to compile TypeScript code
  4. npm run test will execute all main tests. See our approach to testing
  5. npm run test:dos will test against DoS; by measuring function complexity. Takes ~20 minutes
  6. npm run test:big will execute hashing on 4GB inputs, scrypt with 1024 different N, r, p combinations, etc. Takes several hours. Using 8-32+ core CPU helps.

License

The MIT License (MIT)

Copyright (c) 2022 Paul Miller (https://paulmillr.com)

See LICENSE file.

More Repositories

1

chokidar

Minimal and efficient cross-platform file watching library
JavaScript
10,550
star
2

es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
JavaScript
3,119
star
3

encrypted-dns

DNS over HTTPS config profiles for iOS & macOS
2,885
star
4

dotfiles

Colourful & robust configuration files and utilities for Mac, Linux & BSD
Shell
1,182
star
5

exoskeleton

Faster and leaner Backbone for your HTML5 apps
JavaScript
882
star
6

noble-secp256k1

Fastest 4KB JS implementation of secp256k1 signatures and ECDH
JavaScript
695
star
7

noble-curves

Audited & minimal JS implementation of elliptic curve cryptography.
TypeScript
588
star
8

console-polyfill

Browser console methods polyfill.
JavaScript
433
star
9

noble-ed25519

Fastest 4KB JS implementation of ed25519 signatures
JavaScript
388
star
10

readdirp

Recursive version of fs.readdir with streaming api.
JavaScript
376
star
11

top-github-users

GitHub top-1000 generation script
CoffeeScript
262
star
12

ostio

Your open-source talks place.
JavaScript
248
star
13

noble-bls12-381

DEPRECATED. Use noble-curves instead. Fastest JS implementation of BLS12-381.
TypeScript
197
star
14

code-style-guides

Idiomatic, widely-used code style guides for various programming languages.
163
star
15

micro-eth-signer

Minimal library for Ethereum transactions, addresses and smart contracts.
JavaScript
148
star
16

noble-ciphers

Auditable & minimal JS implementation of Salsa20, ChaCha and AES
TypeScript
140
star
17

scaffolt

Dead-simple JSON-based scaffolder.
JavaScript
127
star
18

scure-btc-signer

Audited & minimal library for creating, signing & decoding Bitcoin transactions.
JavaScript
118
star
19

scure-bip39

Secure, audited & minimal implementation of BIP39 mnemonic phrases
TypeScript
108
star
20

async-each

No-bullshit, ultra-simple, 40-lines-of-code async parallel forEach / map function for JavaScript.
JavaScript
105
star
21

qr

Minimal node.js & browser QR Code Pattern reader and generator
JavaScript
96
star
22

scure-base

Secure, audited & 0-deps implementation of bech32, base64, base32, base16 & base58
JavaScript
91
star
23

ostio-api

Your open-source talks place. Rails backend.
Ruby
71
star
24

tx-tor-broadcaster

CLI utility that broadcasts BTC, ETH, SOL, ZEC & XMR transactions through TOR using public block explorers
JavaScript
65
star
25

micro-web3

Typesafe Web3 with minimum deps: call eth contracts directly from JS. Batteries included
TypeScript
59
star
26

scure-starknet

Audited & minimal JS implementation of Starknet cryptography.
JavaScript
59
star
27

native-notifier

Use native system notifications in node.js without third-party libraries
JavaScript
56
star
28

scure-bip32

Secure, audited & minimal implementation of BIP32 hierarchical deterministic (HD) wallets.
TypeScript
50
star
29

chieftain

New generation imageboard. Built with Python / Django.
Python
50
star
30

micro-sol-signer

Create, sign & decode Solana transactions with minimum deps
JavaScript
46
star
31

loggy

Colorful stdstream dead-simple logger for node.js.
JavaScript
42
star
32

Array.prototype.find

Simple ES6 Array.prototype.find polyfill for older environments.
JavaScript
37
star
33

noble-post-quantum

Auditable & minimal JS implementation of public-key post-quantum cryptography
TypeScript
37
star
34

micro-otp

One Time Password generation via RFC 6238
JavaScript
33
star
35

pushserve

Dead-simple pushState-enabled command-line http server.
JavaScript
32
star
36

LiveScript.tmbundle

A TextMate, Chocolat and Sublime Text bundle for LiveScript
Python
30
star
37

micro-packed

Define complex binary structures using composable primitives
TypeScript
29
star
38

jage

age-encryption.org tool implementation in JavaScript
TypeScript
29
star
39

read-components

Read bower and component(1) components
JavaScript
28
star
40

mnp

My new passport
JavaScript
28
star
41

ed25519-keygen

Generate ed25519 keys for SSH, PGP (GPG), TOR, IPNS and SLIP-0010 hdkey
TypeScript
27
star
42

micro-bmark

Benchmark your node.js projects with nanosecond resolution.
JavaScript
27
star
43

Array.prototype.findIndex

Simple ES6 Array.prototype.findIndex polyfill for older environments.
JavaScript
26
star
44

github-pull-req-stats

Stats from GitHub repos about accepted / closed pull requests.
JavaScript
24
star
45

micro-aes-gcm

0-dep wrapper around webcrypto AES-GCM. Has optional RFC 8452 SIV implementation.
JavaScript
24
star
46

steg

Simple and secure steganography
TypeScript
21
star
47

micro-ordinals

Minimal JS library for ordinals and inscriptions on top of scure-btc-signer
JavaScript
21
star
48

nip44

NIP44 spec and implementations of encrypted messages for nostr
Go
20
star
49

papers

Papers i've read and / or wanted to save
17
star
50

noble-ripemd160

Noble RIPEMD160. High-security, easily auditable, 0-dep, 1-file hash function
TypeScript
17
star
51

tag-shell

Use ES6 template tags for your node.js shell commands.
JavaScript
16
star
52

micro-password-generator

Utilities for password generation and estimation with support for iOS keychain
TypeScript
16
star
53

micro-should

Simplest zero-dependency testing framework, a drop-in replacement for Mocha.
JavaScript
16
star
54

micro-promisify

Convert callback-based JS function into promise. Simple, 10LOC, no deps.
JavaScript
16
star
55

bls12-381-keygen

BLS12-381 Key Generation compatible with EIP-2333.
TypeScript
15
star
56

micro-base58

Fast and beautiful base58 encoder without dependencies.
TypeScript
15
star
57

lastfm-tools

Last.FM data reclaimer (backuper, helper and analyzer).
Ruby
14
star
58

micro-ed25519-hdkey

Minimal implementation of SLIP-0010 hierarchical deterministic (HD) wallets
JavaScript
14
star
59

fetch-streaming

Simple XMLHTTPRequest-based `fetch` implementation for streaming content.
JavaScript
13
star
60

unicode-categories

ECMAscript unicode categories. Useful for lexing.
12
star
61

micro-ftch

Tiny optimized `fetch()`-like node.js and browser method with binary/JSON, CORS, redirects & SSL pinning
JavaScript
10
star
62

noble.py

Noble cryptographic libraries in Python. High-security, easily auditable, 0-dep pubkey, scalarmult & EDDSA.
Python
9
star
63

argumentum

No-bullshit option parser for node.js.
JavaScript
8
star
64

micro-es7-shim

No-bullshit super-simple es7 collections shim for Array#includes, Object.values, Object.entries
JavaScript
7
star
65

quickly-copy-file

Quickly copy file from one path to another. No bullshit, ultra-simple, async and just one dep.
JavaScript
6
star
66

microtemplates

John Resig's micro-templates aka underscore templates. No-bullshit and small
JavaScript
6
star
67

micro-ff1

Format-preserving encryption algorithm (FPE-FF1) specified in NIST Special Publication 800-38G.
TypeScript
5
star
68

popular-user-agents

Regularly updated list of popular user agents aka browser versions
JavaScript
5
star
69

eth-vectors

Comprehensive official vectors for ETH
JavaScript
5
star
70

roy.tmbundle

Roy TextMate, Chocolat & Sublime Text 2 bundle
5
star
71

backup

Backup of all my projects in a single signed file
JavaScript
4
star
72

paulmillr

4
star
73

jsbt

Build tools for js projects. Includes tsconfigs, templates and CI workflows
JavaScript
4
star
74

qr-code-vectors

QR Code test vectors
Python
3
star
75

aesscr

Use AES-256-GCM + Scrypt to encrypt files.
JavaScript
3
star
76

universal-path

Cross-platform universal node.js `path` module replacement that works better with Windows
JavaScript
2
star
77

fcache

fs.readFile cache for node.js build systems & watchers
JavaScript
2
star
78

rn-bigint

Java
1
star
79

packed

https://github.com/paulmillr/micro-packed
1
star
80

paulmillr.github.io

JavaScript
1
star