Documentation ¶
Index ¶
- func Decrypt(ciphertext []byte, key *memguard.LockedBuffer) ([]byte, error)
- func DeriveIdentifierN(rootIdentifier *memguard.LockedBuffer, n uint64) []byte
- func DeriveMetaIdentifierN(rootIdentifier *memguard.LockedBuffer, n int) []byte
- func DeriveSecureValues(masterPassword, identifier *memguard.LockedBuffer, costFactor map[string]int) (*memguard.LockedBuffer, *memguard.LockedBuffer)
- func Encrypt(plaintext []byte, key *memguard.LockedBuffer) []byte
- func GenDecoy() (id, ct []byte)
- func GenerateRandomBytes(n int) []byte
- func Pad(text []byte, padTo int) ([]byte, error)
- func Unpad(text []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(ciphertext []byte, key *memguard.LockedBuffer) ([]byte, error)
Decrypt takes a ciphertext and a 32 byte key, decrypts the ciphertext with said key, and then returns the plaintext.
func DeriveIdentifierN ¶
func DeriveIdentifierN(rootIdentifier *memguard.LockedBuffer, n uint64) []byte
DeriveIdentifierN derives a value for derivedIdentifier for a value of `n`.
func DeriveMetaIdentifierN ¶
func DeriveMetaIdentifierN(rootIdentifier *memguard.LockedBuffer, n int) []byte
DeriveMetaIdentifierN does the same as DeriveIdentifierN but uses signed integers instead of unsigned 64 bit unsigned. The intended purpose is for storing metadata and header information.
func DeriveSecureValues ¶
func DeriveSecureValues(masterPassword, identifier *memguard.LockedBuffer, costFactor map[string]int) (*memguard.LockedBuffer, *memguard.LockedBuffer)
DeriveSecureValues derives and returns a masterKey and rootIdentifier.
func Encrypt ¶
func Encrypt(plaintext []byte, key *memguard.LockedBuffer) []byte
Encrypt takes a plaintext and a 32 byte key, encrypts the plaintext with said key using xSalsa20 with a Poly1305 MAC, and returns the ciphertext.
func GenerateRandomBytes ¶
GenerateRandomBytes generates cryptographically secure random bytes.
Types ¶
This section is empty.