crypto

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonIV = []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}
View Source
var ErrPKCS = errors.New("naza.crypto: fxxk")

Functions

func DecryptAESWithCBC

func DecryptAESWithCBC(in []byte, key []byte, iv []byte) ([]byte, error)

func DecryptPKCS5

func DecryptPKCS5(in []byte) ([]byte, error)

func DecryptPKCS7

func DecryptPKCS7(in []byte) ([]byte, error)

func EncryptAESWithCBC

func EncryptAESWithCBC(in []byte, key []byte, iv []byte) ([]byte, error)

key 16字节 -> AES128

24字节 -> AES192
32字节 -> AES256

func EncryptPKCS5

func EncryptPKCS5(in []byte) []byte

func EncryptPKCS7

func EncryptPKCS7(in []byte, blockSize int) []byte

blockSize 取值范围[0, 255]

如果是AES,见标准库中aes.BlockSize等于16

Types

This section is empty.

Jump to

Keyboard shortcuts

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