aes

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBCDecrypt

func CBCDecrypt(encryptedData, key []byte) (decryptedData []byte, err error)

func CBCEncrypt

func CBCEncrypt(origData, key []byte) (crypted []byte, err error)

func ECBDecrypt

func ECBDecrypt(encryptedData, key []byte) (origData []byte, err error)

func ECBDecryptEx

func ECBDecryptEx(encryptedData, key []byte, paddingType PaddingType) (origData []byte, err error)

func ECBEncrypt

func ECBEncrypt(origData, key []byte) (encryptedData []byte, err error)

func ECBEncryptEx

func ECBEncryptEx(origData, key []byte, paddingType PaddingType) (encryptedData []byte, err error)

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncryptor

func NewECBEncryptor(b cipher.Block) cipher.BlockMode

NewECBEncryptor returns a BlockMode which encrypts in electronic code book mode, using the given Block.

func PKCS5Padding

func PKCS5Padding(plaintext []byte) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) ([]byte, error)

func PKCS7Padding

func PKCS7Padding(plaintext []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) ([]byte, error)

func PKCSUnPadding

func PKCSUnPadding(origData []byte) ([]byte, error)

Types

type PaddingType

type PaddingType int
const (
	PaddingTypeNone PaddingType = iota
	PaddingTypePKCS5
	PaddingTypePKCS7
)

Jump to

Keyboard shortcuts

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