An implementation of Shamir's Secret Sharing:
your secret is encrypted into N keys, of which only K are needed to
reconstruct the original secret.
Port of simbo1905/shamir.
It's possible to have a tiered sharing: let's say you want to have admin keys and user keys; allowing either two admin keys or one admin key and three users to recover the secret.
For more info check this link.
Allows splitting the String secret to a given number of keys.
Compared to encryptBytes, adds one extra 32bit integer at the beginning, saying
how many UTF-8 bytes the string has. This is required for correct reconstruction
later with decryptString.
These validation rules are in effect:
Allows deconstructing the Bytes secret from the given keys.
Allows deconstructing the String secret from the given keys.
Compared to decryptBytes, requires one extra 32bit integer at the beginning,
saying how many UTF-8 bytes the string has. This is given automatically during
encryption with encryptString.
The library will fail decrypting if:
decryptString
Allows splitting the Bytes secret to a given number of keys.