A simple utility for breaking an ASCII string into cryptographic shares using Shamir's secret sharing.
npm install secretfracture
bash
npm i secretfracture --save
`
Import
Import the core functions into your file by typing:
`javascript
const {share, recover} = require('secretfracture');
`Usage:
Again, __DON'T__.
At least not for anything that could potentially be compromised.Example of a 3/5 sharing scheme
`javascript
const {share, recover} = require('secretfracture');// split the secret into 5 shares, requiring any 3 to recover
const [indices, shares] = share(5, 3, "th15_15_@_53cr37");
console.log(indices, shares);
// recover the secret from the shares
const secret = recover(indices, shares);
console.log(secret);
`The output will be something similar to:
`bash
[ 1, 2, 3, 4, 5 ] [
'61872a3bd9080624c46c4f78a7bbcbza',
'7b0868bd1712af33dda401bdcc263d94',
'c2edebba1b4f2e8c8b064c01d2b58bf5',
'3533b232e5bf852ecf942f46b966b421',
'd6ddbe267361b31aa84cab8b813ab81a'
]
th15_15_@_53cr37
``