Security considerations for Shamir's Secret Sharing
mainWhen using this library, be aware of the following security constraints:
- Reconstruction integrity: The library does not verify if the reconstructed secret is correct. If shares are corrupted or incorrect,
combinewill produce an incorrect value. You must independently verify the integrity of the reconstructed secret. - Side-channel attacks: Because JavaScript is garbage-collected and JIT-compiled, true constant-time execution cannot be guaranteed, though algorithmic constant-time is targeted where possible.
- Secret entropy: Secrets should be uniformly random. If your secret is not high-entropy, it is recommended to encrypt the value first and split the encryption key instead.
- Input validation: The library assumes inputs are correctly formed. Callers are responsible for validating that inputs to
splitandcombinecome from trusted or validated sources.