https://github.com/adrianosela/multikey
n-out-of-N-keys encryption framework based on shamir's secret sharing algorithm
https://github.com/adrianosela/multikey
Last synced: 8 months ago
JSON representation
n-out-of-N-keys encryption framework based on shamir's secret sharing algorithm
- Host: GitHub
- URL: https://github.com/adrianosela/multikey
- Owner: adrianosela
- License: mpl-2.0
- Created: 2019-08-10T21:01:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T14:51:57.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:52:52.685Z (over 1 year ago)
- Language: Go
- Size: 85 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-cn - multikey - out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. [![godoc][D]](https://godoc.org/github.com/adrianosela/multikey) (安全 / HTTP客户端)
- awesome-go-plus - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm.  (Security / HTTP Clients)
- fucking-awesome-go - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. (Security / HTTP Clients)
- awesome-go-with-stars - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. (Security / HTTP Clients)
- awesome-go - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. (Security / HTTP Clients)
- awesome-go - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. (Security / HTTP Clients)
- awesome-go - multikey - An n-out-of-N keys encryption/decryption framework based on Shamir's Secret Sharing algorithm. (Security / HTTP Clients)
README
# multikey - Require n-of-N keys to decrypt
[](https://goreportcard.com/report/github.com/adrianosela/multikey)
[](https://github.com/adrianosela/multikey/issues)
[](https://godoc.org/github.com/adrianosela/multikey)
[](https://github.com/adrianosela/multikey/blob/master/LICENSE)
[](https://github.com/avelino/awesome-go#security)
#### Allows for the creation of decryption rules for secrets at rest, for example:
- Decrypt if **any** of 5 keys are provided
- Decrypt if **all** of 5 keys are provided
- Decrypt if **at least 3** of 5 keys are provided
#### Example use cases:
- I want anyone on my team to be able to decrypt shared application runtime secrets with their own key locally, and have my deployments be able to decrypt the same secrets by fetching a decryption key from AWS KMS
- I want my team to be able to access a highly privileged secret in emergency situations, by having n/N team members provide their key
... many more
#### Benefits of using this:
- Allows for managing secrets with complex rules
- Allows for secrets to be encrypted at rest, which means they can live on your Github, and you don't have to pay for a database or rely on an external service
## Usage
```
import "github.com/adrianosela/multikey"
```
#### Encrypt:
```
mkEncryptedSecret, err := multikey.Encrypt(plainTxtSecret, pubKeys, requireN)
checkErr(err)
```
#### Decrypt:
```
plainTxtSecret, err := multikey.Decrypt(mkEncryptedSecret, privKeys)
checkErr(err)
```