encryption

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const EndToEndEncryption = 5

EndToEndEncryption means all files are encrypted and decrypted client-side

View Source
const FullEncryptionInput = 4

FullEncryptionInput means all files are encrypted, password needs to be entered on startup

View Source
const FullEncryptionStored = 3

FullEncryptionStored means all files are encrypted, cipher for local files is in plaintext

View Source
const LocalEncryptionInput = 2

LocalEncryptionInput means remote files are stored in plaintext, password needs to be entered on startup

View Source
const LocalEncryptionStored = 1

LocalEncryptionStored means remote files are stored in plaintext, cipher for local files is in plaintext

View Source
const NoEncryption = 0

NoEncryption means all files are stored in plaintext

Variables

This section is empty.

Functions

func CalculateEncryptedFilesize added in v1.6.0

func CalculateEncryptedFilesize(size int64) int64

CalculateEncryptedFilesize returns the filesize of the encrypted file including the encryption overhead

func DecryptReader

func DecryptReader(encInfo models.EncryptionInfo, input io.Reader, output io.Writer) error

DecryptReader modifies a reader so it can decrypt encrypted files

func Encrypt

func Encrypt(encInfo *models.EncryptionInfo, input io.Reader, output io.Writer) error

Encrypt encrypts a file

func EncryptDecryptBytes added in v1.6.0

func EncryptDecryptBytes(input, cipherBlock, nonce []byte, doEncrypt bool) ([]byte, error)

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

func GetDecryptReader(cipherKey []byte, input io.Reader) (io.Reader, error)

GetDecryptReader returns a reader that can decrypt encrypted files

func GetDecryptWriter

func GetDecryptWriter(cipherKey []byte, input io.Writer) (io.Writer, error)

GetDecryptWriter returns a writer that can decrypt encrypted files

func GetEncryptReader

func GetEncryptReader(cipherKey []byte, input io.Reader) (io.Reader, error)

GetEncryptReader returns a reader that can encrypt plain files

func GetEncryptWriter added in v1.6.0

func GetEncryptWriter(cipherKey []byte, input io.Writer) (*sio.EncWriter, error)

GetEncryptWriter returns a writer that can encrypt plain files

func GetRandomCipher

func GetRandomCipher() ([]byte, error)

GetRandomCipher a 32 byte long array with random data

func GetRandomNonce

func GetRandomNonce() ([]byte, error)

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

func PasswordChecksum(pw, salt string) string

PasswordChecksum creates a checksum which is used to check if the supplied password is correct

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL