Documentation
¶
Index ¶
- Constants
- Variables
- func CreateNewKeys(filename string) error
- func DefaultKeysFilename() (string, error)
- func DefaultPasswordFilename() (string, error)
- func FileNaClEncrypt(filename string, compress bool, key *[KeySize]byte) ([]byte, error)
- func LoadKeys(filename string, keys *Keys) error
- func NaClNonce() (*[NonceSize]byte, error)
- func PromptPassword(save bool) ([]byte, error)
- func ReadPassword() ([]byte, error)
- func WritePassword(password []byte) error
- type Header
- type Keys
Constants ¶
View Source
const ( RootDirectory = ".acdbackup" TokenFilename = "acd-token.json" KeysFilename = "keys.json" PasswordFilename = "password" )
View Source
const ( Version = 1 KeySize = 32 NonceSize = 24 )
internal metadata
Variables ¶
View Source
var ( CompNone = [4]byte{'n', 'o', 'n', 'e'} CompGZIP = [4]byte{'g', 'z', 'i', 'p'} )
Functions ¶
func CreateNewKeys ¶
func DefaultKeysFilename ¶
func DefaultPasswordFilename ¶
func FileNaClEncrypt ¶
func PromptPassword ¶
func ReadPassword ¶
func WritePassword ¶
Types ¶
type Header ¶
type Header struct { Version int // header version Compression [4]byte // payload compression Size uint64 // payload size Digest [sha256.Size]byte // payload digest MimeType string // MIME type }
func FileNaClDecrypt ¶
type Keys ¶
type Keys struct { MD [KeySize]byte // uploaded metadata key Data [KeySize]byte // uploaded data key Dedup [KeySize]byte // hmac key for dedup collisions }
func KeysDecrypt ¶
KeysDecrypt decrypts keys from a blob. This function relies on secretbox's property that it'll fail decryption due to authenticators. As such it does not carry a digest to validate the contents.
Click to show internal directories.
Click to hide internal directories.