cryptox

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidBlockSize    = errors.New("cryptox: invalid block size")
	ErrInvalidPKCS7Data    = errors.New("cryptox: invalid PKCS#7 data")
	ErrInvalidPKCS7Padding = errors.New("cryptox: invalid PKCS#7 padding")
)

Functions

func DecodeAESCBC

func DecodeAESCBC(key []byte, data string) ([]byte, error)

func DecodeAESGCM

func DecodeAESGCM(key, iv, aad, ct []byte) ([]byte, error)

func EncodeAESCBC

func EncodeAESCBC(key []byte, data string, encType EncryptType) (string, error)

func Pkcs7Padding

func Pkcs7Padding(data []byte, blockSize int) ([]byte, error)

func Pkcs7Unpadding

func Pkcs7Unpadding(data []byte, blockSize int) ([]byte, error)

Types

type EncryptType

type EncryptType string
const (
	EncryptTypeHex    EncryptType = "hex"
	EncryptTypeBase64 EncryptType = "base64"
)

Jump to

Keyboard shortcuts

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