# @spliterati/shamir

> Arbitrary-length shamir implementation

Latest version **0.5.1** (published 2021-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @spliterati/shamir
pnpm add @spliterati/shamir
yarn add @spliterati/shamir
bun add @spliterati/shamir
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2021-01-30 |
| First published | 2021-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zak Blacher |
| Maintainers | zblach |
| Keywords | shamir, secret, sharing, threshold |

## Links

- npm: https://www.npmjs.com/package/@spliterati/shamir
- Homepage: https://github.com/zblach/spliterati
- Issues: https://github.com/zblach/spliterati/issues
- npm.io page: https://npm.io/package/@spliterati/shamir

## Dependencies (3)

- [@types/node](https://npm.io/package/@types/node.md) ^14.14.20
- [@spliterati/uint8](https://npm.io/package/@spliterati/uint8.md) ^1.0.5
- [@spliterati/utils](https://npm.io/package/@spliterati/utils.md) ^0.3.2

## Recent versions

- 0.5.1 (latest) — 2021-01-30
- 0.5.1-alpha.0 — 2021-01-28
- 0.5.0 — 2021-01-28
- 0.4.0 — 2021-01-28
- 0.3.3-beta.2 — 2021-01-28
- 0.3.3-beta.1 — 2021-01-28
- 0.3.3-alpha.10 — 2021-01-27
- 0.3.3-alpha.9 — 2021-01-27
- 0.3.3-alpha.5 — 2021-01-27
- 0.3.3-alpha.4 — 2021-01-27
- 0.3.3-alpha.3 — 2021-01-27
- 0.3.3-alpha.2 — 2021-01-27
- 0.3.3-alpha.0 — 2021-01-27
- 0.3.2-alpha.5 — 2021-01-27

## README

# `shamir`

This library is a port of the arbitrary-length per-byte shamir secret sharing implementation from [Hashicorp's Vault](https://github.com/hashicorp/vault/blob/master/shamir/shamir.go) product.

I have removed the constant runtime functionality from the galois field arithmetic, as it doesn't really add much to the security of this system.

## Usage

```typescript
import {Shamir} from '@spliterati/shamir';

const secret : Uint8Array = ...;
// ... 
const shares = Shamir.split(secret, 5, 3);

const reassembled = Shamir.combine([shares[0], shares[3], shares[1]]);
// arbitrary indices

expect(secret).toEqual(reassembled);

```

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