Documentation
¶
Index ¶
- Variables
- func CreateAndUpdateVault(fileDEK []byte, fileID uuid.UUID, Verbose bool) error
- func DecryptAndHashStreaming(src io.Reader, dst io.Writer, dek []byte) ([]byte, error)
- func DecryptVault(encData []byte, vaultMasterKey []byte) ([]byte, error)
- func DeleteVault() error
- func DeriveDEK(passphrase string, salt []byte) []byte
- func DeriveVaultMasterKey(password string) ([]byte, error)
- func EncryptAndStoreVault(vaultData Vault, vaultMasterKey []byte) error
- func EncryptFileStreaming(src io.Reader, dst io.Writer, dek []byte) error
- func EncryptVault(vaultBytes []byte, vaultMasterKey []byte) ([]byte, error)
- func GenerateDEKfromPassphrase(passphrase string) (key []byte, salt []byte, err error)
- func GenerateRandomDEK() ([]byte, error)
- func GenerateVaultMasterKey(password string) (key []byte, err error)
- func ObtainFileEncryptionKey(noVault, verbose bool) (fileDEK []byte, fileSalt []byte, err error)
- func StoreVaultMetadata(metadata VaultKeyMetadata) error
- func VaultExists() (bool, error)
- type ArgonParams
- type Vault
- type VaultKeyMetadata
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidVaultKeyOrCorrupted = errors.New("Failed to unlock vault. The password may be incorrect or the vault file may be corrupted.") ErrVaultNotFound = errors.New("vault not found") )
Functions ¶
func CreateAndUpdateVault ¶
Create vault if it doesn't exist, updates it and also generate user relevant errors
func DecryptAndHashStreaming ¶
-Decrypts streaming -Always computes SHA-256 of plaintext -Optionally writes plaintext (if dst != nil) Returns computed hash bytes
func DecryptVault ¶
Decrypt vault data
func DeriveVaultMasterKey ¶
Derive Vault Master Key
func EncryptAndStoreVault ¶
Stores the encrypted vault data in the users home directory ~/.hashdrop/vault.enc
func EncryptFileStreaming ¶
Encrypt file in chunks. [ nonce ][ 4-byte length ][ ciphertext+tag ]
func EncryptVault ¶
Encrypt vault data using AES-GCM standard returns [nonce][ciphertext+tag]
func GenerateDEKfromPassphrase ¶
Generate DEK from passphrase for no-vault users
func GenerateRandomDEK ¶
Generate random DEK for vault users
func GenerateVaultMasterKey ¶
Generate Vault Master Key from password string
func ObtainFileEncryptionKey ¶
Create Data Encryption Key for vault user and no-vault users and also generate user relevant errors
func StoreVaultMetadata ¶
func StoreVaultMetadata(metadata VaultKeyMetadata) error
Store the meta data in the users home directory ~/.hashdrop/vault_meta.json
Types ¶
type ArgonParams ¶
type VaultKeyMetadata ¶
type VaultKeyMetadata struct {
Version int `json:"version"`
Argon ArgonParams `json:"argon"`
Salt []byte `json:"vault_salt"`
}
Vault key meta data