aes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyLengthSixteen      = errors.New("a sixteen or twenty-four or thirty-two length secret key is required")
	ErrPaddingSize           = errors.New("padding size error please check the secret key or iv")
	ErrTextNotMultiBlockSize = errors.New("text size is not multi times of block size")
)

各类错误

Functions

func Base64URLSafe

func Base64URLSafe(text string) string

func Decrypt

func Decrypt(keyStr string, text string) (string, error)

func DecryptECBMode

func DecryptECBMode(key, encrypted []byte) (decrypted []byte, err error)

DecryptECBMode AES128-ECB模式解密

func Encrypt

func Encrypt(keyStr string, text string) (string, error)

func EncryptECBMode

func EncryptECBMode(key, plainText []byte) (encrypted []byte, err error)

EncryptECBMode AES128-ECB模式加密

func HiDecrypt

func HiDecrypt(base64Key string, base64Encrypted string) (decrypted string, err error)

HiDecrypt 如流消息解密

func HiEncrypt

func HiEncrypt(base64Key string, plainText string) (base64Encrypted string, err error)

HiEncrypt 如流消息加密

func PKCS5Padding

func PKCS5Padding(plainText []byte, blockSize int) []byte

PKCS5Padding PKCS5填充

func PKCS5UnPadding

func PKCS5UnPadding(plainText []byte, blockSize int) ([]byte, error)

PKCS5UnPadding PKCS5去填充

Types

This section is empty.

Jump to

Keyboard shortcuts

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