# kyber-crystals

> JavaScript wrapper for a WebAssembly build of Kyber

Latest version **1.0.7** (published 2023-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install kyber-crystals
pnpm add kyber-crystals
yarn add kyber-crystals
bun add kyber-crystals
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-07-17 |
| First published | 2022-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 90.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Cyph, Inc. |
| Maintainers | cyphinc |
| Keywords | cryptography, post-quantum, kyber, asm.js, webassembly |

## Links

- npm: https://www.npmjs.com/package/kyber-crystals
- Repository: https://github.com/cyph/pqcrypto.js
- Homepage: https://github.com/cyph/pqcrypto.js#readme
- Issues: https://github.com/cyph/pqcrypto.js/issues
- npm.io page: https://npm.io/package/kyber-crystals

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2023-07-17
- 1.0.6 — 2023-05-21
- 1.0.5 — 2023-01-26
- 1.0.4 — 2022-08-06
- 1.0.3 — 2022-07-13
- 1.0.2 — 2022-07-12

## README

# kyber-crystals

## Overview

The [Kyber](https://pq-crystals.org/kyber) post-quantum asymmetric
cypher compiled to WebAssembly using [Emscripten](https://github.com/kripken/emscripten).
A simple JavaScript wrapper is provided to make Kyber easy to use in web applications.

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

## Example Usage

	import {kyber} from 'kyber-crystals';

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

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

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

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

---
_Source: https://npm.io/package/kyber-crystals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
