aes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IVDefaultValue = "Hello, world!"
)

Functions

func Decrypt

func Decrypt(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)

func DecryptCBC

func DecryptCBC(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)

key 必须是16/24/32 位长

func DecryptCFB

func DecryptCFB(cipherText []byte, key []byte, unPadding int, iv ...[]byte) ([]byte, error)

key 必须是16/24/32 位长

func Encrypt

func Encrypt(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)

func EncryptCBC

func EncryptCBC(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)

key 必须是16/24/32 位长

func EncryptCFB

func EncryptCFB(plainText []byte, key []byte, padding *int, iv ...[]byte) ([]byte, error)

key 必须是16/24/32 位长

func PKCS5Padding

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

func PKCS5UnPadding

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

func ZeroPadding

func ZeroPadding(cipherText []byte, blockSize int) ([]byte, int)

func ZeroUnPadding

func ZeroUnPadding(plaintext []byte, unPadding int) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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