Open lordofscripts opened 4 months ago
Hi @lordofscripts -- if you're looking for a mature and tested Shamir's library, I'd suggest checking out https://pkg.go.dev/github.com/openbao/openbao/sdk@v1.100.0-development20240408/helper/shamir
Hi @lordofscripts -- if you're looking for a mature and tested Shamir's library, I'd suggest checking out https://pkg.go.dev/github.com/openbao/openbao/sdk@v1.100.0-development20240408/helper/shamir
Thanks for the lead. I looked into it but unfortunately it drags a lot of other stuff with it. I settled for RSA Shamir Secret Sharing which is bare ones and has the necessary building blocks.
If the disclaimer in the RSA one is an issue, I'd probably take a PR to add a separate go module for Shamir's upstream in OpenBao.
Create()
andCombine()
return TWO parameters: data, error.Create()
function is returning an array of shards, but as it turns out each of the shards/secrets has the Base64 string twice, thus, attempts to decode the Base64 result in an error. Below a sample output of the first "secret" in the list:Here is the result of the following statement prior to attempting Base64 decode:
fmt.Printf("\nShard #%d %T\n\t%s\n", i, shard, shard, shard)
As you can observe, each of the returned secrets has the Base64 value followed by what it appears to be the same value (repeated) as a result of a badly formatted
SPrintf()
statement.