symmetric

package
v0.0.0-...-c1fbc2c Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor interface {
	Encrypt(plaintext []byte) ([]byte, error)
	Decrypt(ciphertext []byte) ([]byte, error)
}

Encryptor does symmetric encryption and decryption.

func New

func New(key string, opts ...Option) (Encryptor, error)

New allocates and configures an Encryptor.

type Option

type Option func(*config)

Option is optional configuration of the encryptor.

func WithBlockCypherProvider

func WithBlockCypherProvider(provider func(key []byte) (cipher.Block, error)) Option

WithBlockCypherProvider overwrites the provider for the block cipher.

func WithRandomDataFunc

func WithRandomDataFunc(randomDataFunc func(buffer []byte) error) Option

WithRandomDataFunc overwrites the random data function.

Jump to

Keyboard shortcuts

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