SSSaaS / sssa-golang

Shamir's Secret Sharing Algorithm - helper cryptography module for Golang
MIT License
143 stars 31 forks source link

Create function returning bad Base64 values #8

Open lordofscripts opened 4 months ago

lordofscripts commented 4 months ago

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)

Shard #0 string
    CxhWcKn2w3_TzcIbQZr0KQe7IBqLiL_9uZsT-_bWMkM=EkW1Z-EsCm3u061sXnK3_5N60hSP_bGmz7L4pX-eRww=
%!(EXTRA string=CxhWcKn2w3_TzcIbQZr0KQe7IBqLiL_9uZsT-_bWMkM=EkW1Z-EsCm3u061sXnK3_5N60hSP_bGmz7L4pX-eRww=)

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.

cipherboy commented 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

lordofscripts commented 3 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

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.

cipherboy commented 3 months ago

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.