encryption

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAESEncryptor

func NewAESEncryptor(block cipher.Block, initialVector string) aesEncryptor

Types

type Encryption

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

func NewEncryption

func NewEncryption(encryptor Encryptor) *Encryption

func (*Encryption) DecodeStr

func (e *Encryption) DecodeStr(encryptedBase64Str string) ([]byte, error)

func (*Encryption) EncodeStr

func (e *Encryption) EncodeStr(plaintext []byte) (string, error)

type Encryptor

type Encryptor interface {
	Encode(plaintext []byte) ([]byte, error)
	Decode(encryptedplaintext []byte) ([]byte, error)
}

type StrEncodeDecoder

type StrEncodeDecoder interface {
	EncodeToString([]byte) string
	DecodeString(string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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