drivers

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESDriver

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

AESDriver implements AES encryption with CBC and GCM modes

func NewAESDriver

func NewAESDriver(key []byte, previousKeys [][]byte, cipher string) (*AESDriver, error)

NewAESDriver creates a new AES driver

func (*AESDriver) Decrypt

func (d *AESDriver) Decrypt(payload string) (string, error)

Decrypt decrypts a payload

func (*AESDriver) DecryptBytes

func (d *AESDriver) DecryptBytes(payload string) ([]byte, error)

DecryptBytes decrypts a payload to bytes

func (*AESDriver) Encrypt

func (d *AESDriver) Encrypt(plaintext string) (string, error)

Encrypt encrypts plaintext

func (*AESDriver) EncryptBytes

func (d *AESDriver) EncryptBytes(plaintext []byte) (string, error)

EncryptBytes encrypts bytes

func (*AESDriver) GenerateKey

func (d *AESDriver) GenerateKey() (string, error)

GenerateKey generates a new encryption key

type Payload

type Payload struct {
	IV    string `json:"iv"`
	Value string `json:"value"`
	MAC   string `json:"mac,omitempty"`
	Tag   string `json:"tag,omitempty"`
}

Payload represents the encrypted data structure

Jump to

Keyboard shortcuts

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