Documentation ¶
Overview ¶
Package keycrypter provides two ways to safely store secret encryption keys.
1) Password protection. - Ask user for password and encrypt the key using the password before storing.
2) Shamir's Secret Sharing. - Use Shamir's Secret Sharing algorithm to split the key into several parts and store in different places(media). All or a threshold count of the split keys are needed for reconstruct the key.
Index ¶
- func DecryptKeySSS(shares [][]byte) ([]byte, error)
- func DecrytKey(cipherKey []byte, password string) ([]byte, error)
- func EncryptKey(key []byte, password string) ([]byte, error)
- func EncryptKeySSS(key []byte, n, k byte) ([][]byte, error)
- func LoadKey(path string, pwdfile string, password string) ([]byte, error)
- func LoadKeySSS(paths []string) ([]byte, error)
- func StoreKey(path string, pwd string, key []byte) error
- func StoreKeySSS(paths []string, k byte, key []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptKeySSS ¶ added in v0.3.1
DecryptKeySSS decrypt key using Shamir's Secret Sharing scheme. Return error when the given sharing parts are broken or not enough.
func EncryptKey ¶
EncryptKey encrypt the key using password
func EncryptKeySSS ¶ added in v0.3.1
EncryptKeySSS encrypt key using Shamir's Secret Sharing scheme. N is numbers of sharing parts to be created and k is the number threshold of parts for reconstructing key
func LoadKey ¶
LoadKey loads key from the password encrypted key file located at `path`, with `password` or password reading from the `pwdfile`
func LoadKeySSS ¶ added in v0.3.1
LoadKeySSS loads key from the sharing key files
Types ¶
This section is empty.