Documentation
¶
Overview ¶
Package crypto implements common symmetric-encryption and key-derivation functions.
Index ¶
- Constants
- func DecryptAes256Gcm(data, masterKey, salt []byte) ([]byte, error)
- func DeriveKeyFromMasterKey(masterKey, salt, purpose []byte, length int) []byte
- func DeriveKeyFromPassword(password string, salt []byte, algorithm string) ([]byte, error)
- func EncryptAes256Gcm(data, masterKey, salt []byte) ([]byte, error)
- func RegisterKeyDerivationFunc(name string, keyDeriver keyDerivationFunc)
Constants ¶
View Source
const ( // MasterKeyLength describes the length of the master key. MasterKeyLength = 32 // ScryptAlgorithm is the key for the scrypt algorithm. ScryptAlgorithm = "scrypt-65536-8-1" // Pbkdf2Algorithm is the key for the pbkdf algorithm. Pbkdf2Algorithm = "pbkdf2" )
View Source
const DefaultKeyDerivationAlgorithm = ScryptAlgorithm
DefaultKeyDerivationAlgorithm is the key derivation algorithm for new configurations.
Variables ¶
This section is empty.
Functions ¶
func DecryptAes256Gcm ¶
DecryptAes256Gcm encrypts data with AES 256 GCM.
func DeriveKeyFromMasterKey ¶
DeriveKeyFromMasterKey computes a key for a specific purpose and length using HKDF based on the master key.
func DeriveKeyFromPassword ¶
DeriveKeyFromPassword derives encryption key using the provided password and per-repository unique ID.
func EncryptAes256Gcm ¶
EncryptAes256Gcm encrypts data with AES 256 GCM.
func RegisterKeyDerivationFunc ¶ added in v0.16.0
func RegisterKeyDerivationFunc(name string, keyDeriver keyDerivationFunc)
RegisterKeyDerivationFunc registers various key derivation functions.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.