encryption

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 6 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 struct {
	// contains filtered or unexported fields
}

Encryptor handles AES256-CBC encryption/decryption operations Compatible with OpenSSL command line tools

func NewEncryptor

func NewEncryptor(key string) (*Encryptor, error)

NewEncryptor creates a new encryptor with the given key The key will be hashed to ensure it's exactly 32 bytes for AES256

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt decrypts ciphertext using AES256-CBC Expects the IV to be prepended to the ciphertext (OpenSSL compatible format)

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext using AES256-CBC Returns the encrypted data with the IV prepended (OpenSSL compatible format)

Jump to

Keyboard shortcuts

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