Documentation ¶
Index ¶
- Constants
- func CalculateEncryptedFilesize(size int64) int64
- func DecryptReader(encInfo models.EncryptionInfo, input io.Reader, output io.Writer) error
- func Encrypt(encInfo *models.EncryptionInfo, input io.Reader, output io.Writer) error
- func EncryptDecryptBytes(input, cipherBlock, nonce []byte, doEncrypt bool) ([]byte, error)
- func GetCipherFromFile(encInfo models.EncryptionInfo) ([]byte, error)
- func GetDecryptReader(cipherKey []byte, input io.Reader) (io.Reader, error)
- func GetDecryptWriter(cipherKey []byte, input io.Writer) (io.Writer, error)
- func GetEncryptReader(cipherKey []byte, input io.Reader) (io.Reader, error)
- func GetEncryptWriter(cipherKey []byte, input io.Writer) (*sio.EncWriter, error)
- func GetRandomCipher() ([]byte, error)
- func GetRandomNonce() ([]byte, error)
- func Init(config models.Configuration)
- func IsCorrectKey(encInfo models.EncryptionInfo, input *os.File) bool
- func PasswordChecksum(pw, salt string) string
Constants ¶
const EndToEndEncryption = 5
EndToEndEncryption means all files are encrypted and decrypted client-side
const FullEncryptionInput = 4
FullEncryptionInput means all files are encrypted, password needs to be entered on startup
const FullEncryptionStored = 3
FullEncryptionStored means all files are encrypted, cipher for local files is in plaintext
const LocalEncryptionInput = 2
LocalEncryptionInput means remote files are stored in plaintext, password needs to be entered on startup
const LocalEncryptionStored = 1
LocalEncryptionStored means remote files are stored in plaintext, cipher for local files is in plaintext
const NoEncryption = 0
NoEncryption means all files are stored in plaintext
Variables ¶
This section is empty.
Functions ¶
func CalculateEncryptedFilesize ¶ added in v1.6.0
CalculateEncryptedFilesize returns the filesize of the encrypted file including the encryption overhead
func DecryptReader ¶
DecryptReader modifies a reader so it can decrypt encrypted files
func EncryptDecryptBytes ¶ added in v1.6.0
EncryptDecryptBytes encrypts or decrypts a byte array
func GetCipherFromFile ¶
func GetCipherFromFile(encInfo models.EncryptionInfo) ([]byte, error)
GetCipherFromFile loads the cipher from a file model
func GetDecryptReader ¶
GetDecryptReader returns a reader that can decrypt encrypted files
func GetDecryptWriter ¶
GetDecryptWriter returns a writer that can decrypt encrypted files
func GetEncryptReader ¶
GetEncryptReader returns a reader that can encrypt plain files
func GetEncryptWriter ¶ added in v1.6.0
GetEncryptWriter returns a writer that can encrypt plain files
func GetRandomCipher ¶
GetRandomCipher a 32 byte long array with random data
func GetRandomNonce ¶
GetRandomNonce a 12 byte long array with random data
func Init ¶
func Init(config models.Configuration)
Init needs to be called to load the master key into memory or ask the user for the password
func IsCorrectKey ¶ added in v1.6.0
func IsCorrectKey(encInfo models.EncryptionInfo, input *os.File) bool
IsCorrectKey checks if correct key is being used. This does not check for complete file authentication.
func PasswordChecksum ¶
PasswordChecksum creates a checksum which is used to check if the supplied password is correct
Types ¶
This section is empty.