Skip to content

Commit f23838f

Browse files
committed
Audit
1 parent c2987b3 commit f23838f

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
[![npm version][1]][2] [![Travis CI][3]][4] [![license][5]][6] [![Types][7]][8]
44

5-
This package contains all pure-js cryptographic primitives normally used when
5+
All pure-js cryptographic primitives normally used when
66
developing Javascript / TypeScript applications and tools for Ethereum.
77

8+
**January 2022 update:** Version 1.0 of the package is out. The module has been completely rewritten:
9+
10+
- **6x smaller:** 4,000 lines of code instead of 22,438 (with all deps); 185KB instead of 755KB
11+
- 3 dependencies by one author instead of 38 by 5 authors
12+
- [Audited](#security) by an independent security firm
13+
814
The cryptographic primitives included are:
915

1016
* [Hashes: SHA256, keccak-256, RIPEMD160, BLAKE2b](#hashes-sha256-keccak-256-ripemd160-blake2b)
@@ -15,30 +21,16 @@ The cryptographic primitives included are:
1521
* [BIP39 Mnemonic phrases](#bip39-mnemonic-phrases)
1622
* [AES Encryption](#aes-encryption)
1723

18-
**October 2021 update:** We're releasing **experimental** version 0.2 of the package.
19-
The module has been completely rewritten:
20-
21-
- ~6x smaller: 4,000 lines of code instead of 22,438 (with all deps); 185KB instead of 755KB
22-
- 3 dependencies (pending an audit) instead of 38
23-
- **Same functionality**, all old APIs remain the same except for two breaking changes:
24-
1. We return `Uint8Array` from all methods that worked with `Buffer` before.
25-
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
26-
browsers and node.js. See [Upgrading](#upgrading)
27-
2. We target runtimes with [bigint](https://caniuse.com/bigint) support,
28-
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support older runtimes, use `[email protected]`
29-
3. If you've used `secp256k1`, [rename it to `secp256k1-compat`](#legacy-secp256k1-compatibility-layer)
30-
- The new module [has not been audited yet](#security), but it's in the process of getting the audit. Use it at your own risk
31-
3224
## Usage
3325

3426
Use NPM / Yarn in node.js / browser:
3527

3628
```bash
3729
# NPM
38-
npm install ethereum-cryptography@next
30+
npm install ethereum-cryptography
3931

4032
# Yarn
41-
yarn add ethereum-cryptography@next
33+
yarn add ethereum-cryptography
4234
```
4335

4436
See [browser usage](#browser-usage) for information on using the package with major Javascript bundlers. It is
@@ -205,6 +197,9 @@ Note: if you've been using ethereum-cryptography v0.1, it had different API. We'
205197

206198
## BIP32 HD Keygen
207199

200+
Hierarchical deterministic (HD) wallets that conform to BIP32 standard.
201+
Also available as standalone package [micro-bip32](https://github.com/paulmillr/micro-bip32).
202+
208203
This module exports a single class `HDKey`, which should be used like this:
209204

210205
```ts
@@ -283,6 +278,8 @@ function mnemonicToSeedSync(mnemonic: string, passphrase: string = ""): Uint8Arr
283278
The `bip39` submodule provides functions to generate, validate and use seed
284279
recovery phrases according to [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).
285280

281+
Also available as standalone package [micro-bip39](https://github.com/paulmillr/micro-bip39).
282+
286283
```js
287284
const { generateMnemonic } = require("ethereum-cryptography/bip39");
288285
const { wordlist } = require("ethereum-cryptography/bip39/wordlists/english");
@@ -449,14 +446,16 @@ you found another primitive that is missing.
449446

450447
## Upgrading
451448

452-
Version 0.2 changes from 0.1:
449+
Version 1.0 changes from 0.1:
450+
451+
**Same functionality**, all old APIs remain the same except for the breaking changes:
453452

454-
- **Breaking:** we target runtimes with [bigint](https://caniuse.com/bigint) support,
455-
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support
456-
older runtimes, use `[email protected]`
457-
- **Breaking:** we return `Uint8Array` from all methods that worked with `Buffer` before.
458-
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
459-
browsers and node.js:
453+
1. We return `Uint8Array` from all methods that worked with `Buffer` before.
454+
`Buffer` has never been supported in browsers, while `Uint8Array`s are supported natively in both
455+
browsers and node.js. See [Upgrading](#upgrading)
456+
2. We target runtimes with [bigint](https://caniuse.com/bigint) support,
457+
which is Chrome 67+, Edge 79+, Firefox 68+, Safari 14+, node.js 10+. If you need to support older runtimes, use `[email protected]`
458+
3. If you've used `secp256k1`, [rename it to `secp256k1-compat`](#legacy-secp256k1-compatibility-layer)
460459

461460
```
462461
const { sha256 } = require("ethereum-cryptography/sha256");
@@ -475,7 +474,7 @@ const hashbo = hashb.toString("hex");
475474

476475
## Security
477476

478-
This library is in the process of getting a security audit.
477+
Audited by Cure53 on Jan 5, 2022. Check out the audit [PDF](./audit/2022-01-05-cure53-audit-nbl2.pdf) & [URL](https://cure53.de/pentest-report_hashing-libs.pdf).
479478

480479
## License
481480

312 KB
Binary file not shown.

audit/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Audit
2+
3+
The PDF was saved from cure53.de site: [URL](https://cure53.de/pentest-report_hashing-libs.pdf). See information about audit and fuzzing in root [README](../README.md).

0 commit comments

Comments
 (0)