extcfs

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AESGCM256CFS represent AES (Advanced Encryption Standard) with GCM (Galois/Counter Mode)
	AESGCM256CFS = iota
)

Variables

AllCiphers contains map to all default ciphers

Functions

func NewCipher

func NewCipher(defaultCiperKey CipherKey, mapping CipherMap) (result cipherfs.Cipher, err error)

NewCipher Create new Cipher Instance

func NewDefaultCipher

func NewDefaultCipher() (result cipherfs.Cipher)

NewDefaultCipher Create new Cipher with default data

Types

type Cipher

type Cipher struct {
	// contains filtered or unexported fields
}

Cipher provide encrypt/decrypt functions

func (Cipher) Decrypt

func (c Cipher) Decrypt(key []byte, data []byte) (decrypted []byte, err error)

Decrypt AES GCM data with key

func (Cipher) DecryptReader

func (c Cipher) DecryptReader(key []byte, stream filesystem.Reader) (reader filesystem.Reader, err error)

DecryptReader create decrypt stream for AES GCM

func (Cipher) Encrypt

func (c Cipher) Encrypt(key []byte, data []byte) (encrypted []byte, err error)

Encrypt AES GCM data with key

func (Cipher) EncryptWriter

func (c Cipher) EncryptWriter(key []byte, stream filesystem.Writer) (writer filesystem.Writer, err error)

EncryptWriter create encrypt stream for AES GCM

type CipherKey

type CipherKey uint32

CipherKey is default cipher key type

func NewCipherKey

func NewCipherKey(b []byte) CipherKey

NewCipherKey create new cipher key from bytes

func (CipherKey) ToBinary

func (key CipherKey) ToBinary() (b []byte)

ToBinary return binary key representation

type CipherMap

type CipherMap map[CipherKey]cipherfs.Cipher

CipherMap contains map to ciper

Jump to

Keyboard shortcuts

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