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, keySize int, algorithm string) ([]byte, error)
- func EncryptAes256Gcm(data, masterKey, salt []byte) ([]byte, error)
Constants ¶
View Source
const (
// Pbkdf2Algorithm is the key for the pbkdf algorithm.
Pbkdf2Algorithm = "pbkdf2-sha256-600000"
)
View Source
const (
// ScryptAlgorithm is the registration name for the scrypt algorithm instance.
ScryptAlgorithm = "scrypt-65536-8-1"
)
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 ¶
func DeriveKeyFromPassword(password string, salt []byte, keySize int, algorithm string) ([]byte, error)
DeriveKeyFromPassword derives encryption key using the provided password and per-repository unique ID.
func EncryptAes256Gcm ¶
EncryptAes256Gcm encrypts data with AES 256 GCM.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.