Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDifferentMACSum = errors.New("mac sum don't match")
ErrDifferentMACSum is returned if the mac sum of the file doesn't match the computed mac sum. This means that the file has been corrupted, be very careful, someone might be trying to attack
var ErrInvalidPadding = errors.New("invalid padding")
ErrInvalidPadding is returned if the padding of the plaintext during decryption doesn't match the expected format. This isn't a good sign, and may reveal to be an attack (see padding oracle)
Functions ¶
func JoinRootPath ¶
JoinRootPath joins 2 paths, but guarantees that it will not go higher than root
Types ¶
type Cryptor ¶
type Cryptor struct {
// contains filtered or unexported fields
}
Cryptor is a simple API which writes and read encrypted files using the password given to the constructor
func NewCryptor ¶
NewCryptor creates a new cryptor which saves/loads encrypted files using the mackey and the enckey
type User ¶
type User struct { // root is the user's own folder (see api.go) ID int Email string // contains filtered or unexported fields }
UserDB is the folder containing all the user's data. Everything in their is encrypted using his password