fragment-key
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Fragment-key

Private Key Fragmentize & recover module.

Split your private key and share to trustworthies in case of losing your key!

fragment drawio

🏃‍♂Usage

Common (Initialization)

//node.js
import crypto from 'node:crypto'
import { Generator } from 'fragment-key'

Generator.initialize(crypto);
//Browser
import { Generator } from 'fragment-key'

Generator.initialize(window.crypto);
//Any custom Crypto library
import { Generator } from 'fragment-key'
import CustomCryptoLibrary from 'my-custom-library'

Generator.initialize(CustomCryptoLibrary, false);

*** NOTE Custom Crypto library should implement CryptoModule interface

Create Fragments

const key = '123123123'
const gen = new Generator(3, key); // at least 3 fragment will be required to recover key
const fragments = await gen.fragmentize(10); // will generate 10 fragment

recover

const myKey = Generator.recover(fragments);

Create Fragment recovery phase

In case, forgetting fragment, generate your fragment recovery phase. You won't be able to find back your fragment if you lose recovery phase

const recoveryPhase = await Generator.generateFragmentRecoveryPhase(fragment, password)

Recover Fragment

  const fragment = await Generator.recoverFragment(recoveryPhase, password);

Readme

Keywords

Package Sidebar

Install

npm i fragment-key

Weekly Downloads

1

Version

1.0.8

License

none

Unpacked Size

54.4 kB

Total Files

11

Last publish

Collaborators

  • dovigod