aes

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBCDecryptData added in v1.0.14

func CBCDecryptData(secretData, key []byte) ([]byte, error)

解密数据的Bytes数组

func CBCDecryptIvData added in v1.0.14

func CBCDecryptIvData(secretData, key, iv []byte) ([]byte, error)

解密数据的Bytes数组

func CBCEncryptData added in v1.0.14

func CBCEncryptData(originData, key []byte) ([]byte, error)

加密后的Bytes数组

func CBCEncryptIvData added in v1.0.14

func CBCEncryptIvData(originData, key, iv []byte) ([]byte, error)

加密后的Bytes数组

func GCMDecrypt added in v1.0.14

func GCMDecrypt(cipherText, nonce, additional, key []byte) ([]byte, error)

func GCMEncrypt added in v1.0.14

func GCMEncrypt(originText, additional, key []byte) (nonce []byte, cipherText []byte, err error)

func PKCS5Padding

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

加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

解密填充模式(去除补全码) PKCS5UnPadding 解密时,需要在最后面去掉加密时添加的填充byte

func PKCS7Padding

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

加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) (bs []byte)

解密填充模式(去除补全码) PKCS7UnPadding 解密时,需要在最后面去掉加密时添加的填充byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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