encryption

package
v0.0.0-...-dde4a86 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Encrypted determines whether or not the FS is encrypted
	Encrypted bool
)

Functions

func CipherSize

func CipherSize() int

CipherSize returns the size of the cipher used

func Decrypt

func Decrypt(data []byte) error

Decrypt decrypts the given data in place

func Encrypt

func Encrypt(data []byte) error

Encrypt encrypts the given data in place

func GenerateAESCipherBlock

func GenerateAESCipherBlock(key []byte) (cipherBlock cipher.Block, err error)

GenerateAESCipherBlock generates the cipher used for encryption and decryption of data It takes in a byte array key and returns an error if the key is not of size 16, 24 or 32 or when the cipher failed to initialize.

func LastBlockSize

func LastBlockSize(r *os.File) (size int, err error)

LastBlockSize reads the size of the last block from the beginning of the file

func SetCipher

func SetCipher(cb cipher.Block)

SetCipher sets a cipher to be used for data encyption and decryption

Types

This section is empty.

Jump to

Keyboard shortcuts

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