encryption

package
v0.0.0-...-12a4b7c Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package encryption provides functions for encrypting and decrypting data using AES-GCM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key, encryptedData, info []byte) ([]byte, error)

Decrypt decrypts the given data using the master key and the given info.

func DeriveKey

func DeriveKey(key, info []byte) ([]byte, error)

DeriveKey derives a key from the master key and the given info.

func Encrypt

func Encrypt(key, data, info []byte) ([]byte, error)

Encrypt encrypts the given data using the master key and the given info.

Types

type Splitter

type Splitter struct {
	chunk.Splitter
	// contains filtered or unexported fields
}

Splitter is a splitter that encrypts the data before splitting it. It's not valid to use the same splitter for multiple files.

func NewSplitter

func NewSplitter(key []byte, reader io.Reader, blockSize int64) (*Splitter, error)

NewSplitter creates a new EncryptedSplitter with the given key.

func (*Splitter) NextBytes

func (s *Splitter) NextBytes() ([]byte, error)

NextBytes is ovveriden version of splitter.NextBytes().

Jump to

Keyboard shortcuts

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