Documentation
¶
Overview ¶
Package shamir implements Shamir Secret Sharing (SSS) scheme that splits a password into independent parts. This package is copied from HashiCorp vault in order to avoid adding a large dependency. Vault moved to BSL license on Aug 16, 2023, but this package remained with MPL-2.0 license, a copy of which is saved in the `./LICENSE` file.
Index ¶
Constants ¶
const ( // when using Split on a secret. This is caused by appending // a one byte tag to the share. ShareOverhead = 1 )
Variables ¶
This section is empty.
Functions ¶
func Combine ¶
Combine is used to reverse a Split and reconstruct a secret once a `threshold` number of parts are available.
func Split ¶
Split takes an arbitrarily long secret and generates a `parts` number of shares, `threshold` of which are required to reconstruct the secret. The parts and threshold must be at least 2, and less than 256. The returned shares are each one byte longer than the secret as they attach a tag used to reconstruct the secret.
Types ¶
This section is empty.