Documentation
¶
Overview ¶
Package vault seals data with a password, for the backups that take SSHYard's data, secrets included, out of the keychain: the data is encrypted under a random vault key (XChaCha20-Poly1305), and the vault key is wrapped under a key derived from the password (Argon2id). The password itself is never stored.
A sealed file is JSON: a plaintext header (the format, its version, when it was made and the wrapped keys) and the encrypted body, whose authentication covers the header too, so neither can be changed alone.
Index ¶
Constants ¶
const Format = "sshyard-vault"
Format names a sealed file in its header.
const Version = 1
Version is the version of the format this package writes and reads.
Variables ¶
var ( // ErrFormat reports data that is not a sealed file. ErrFormat = errors.New("vault: not an SSHYard backup") // ErrVersion reports a file of a newer format than this app reads. ErrVersion = errors.New("vault: made by a newer version of SSHYard") // ErrPassword reports a password that does not open the file (or a // file whose wrapped key was damaged; the two can not be told apart). ErrPassword = errors.New("vault: wrong password") // ErrCorrupt reports a file whose body was damaged or changed. ErrCorrupt = errors.New("vault: the file is damaged") )
var DefaultParams = Params{Time: 3, Memory: 64 << 10, Threads: 4}
DefaultParams are what Seal uses in the app: 3 passes over 64 MiB on 4 lanes: well under a second on a current machine, and costly to guess against.
Functions ¶
func Check ¶
Check reports whether b is a sealed file this package can open, without the password: ErrFormat, ErrVersion or nil.