4.0.4 • Published 2 years ago

ntru v4.0.4

Weekly downloads
52
License
MIT
Repository
github
Last release
2 years ago

ntru

Overview

The NTRU Prime post-quantum asymmetric cypher compiled to WebAssembly using Emscripten. A simple JavaScript wrapper is provided to make NTRU easy to use in web applications.

The default parameter set is sntrup1277 (roughly 256-bit strength).

Example Usage

import {ntru} from 'ntru';

const keyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ =
	await ntru.keyPair()
;

const {cyphertext, secret} /*: {cyphertext: Uint8Array; secret: Uint8Array} */ =
	await ntru.encrypt(keyPair.publicKey)
;

const decrypted /*: Uint8Array */ =
	await ntru.decrypt(cyphertext, keyPair.privateKey) // same as secret
;

console.log(keyPair);
console.log(secret);
console.log(cyphertext);
console.log(decrypted);

Changelog

Breaking changes in major versions:

4.0.0:

  • Switched from legacy NTRUEncrypt to NTRU Prime. For backwards compatibility with previous versions of this package, use ntru-legacy.

3.0.0:

  • As part of upgrading from asm.js to WebAssembly (with asm.js included as a fallback), the API is fully asynchronous.

2.0.0:

  • Removed some undocumented functions as part of minor API cleanup.
4.0.4

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.2.4

3 years ago

3.2.3

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.2.2

5 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.2.0-next

6 years ago

3.1.8

7 years ago

3.1.7

7 years ago

3.1.6

7 years ago

3.1.5

7 years ago

3.1.4

7 years ago

3.1.3

7 years ago

3.1.2

8 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago