Based on github.com/codahale/sss
A pure Go implementation of Shamir's Secret Sharing algorithm
go get -u github.com/lafriks/go-shamir
package main
import (
"fmt"
"github.com/lafriks/go-shamir"
)
func main() {
secret := []byte("example")
// Split secret to 5 shares and require 3 shares to reconstruct secret
shares, err := shamir.Split(secret, 5, 3)
if err != nil {
panic(err)
}
// Reconstruct secret from shares
reconstructed, err := shamir.Combine(shares[0], shares[2], shares[4])
if err != nil {
panic(err)
}
// secret == reconstructed
}