crypto

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 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 added in v0.19.0

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

func DecryptPkcs5 added in v0.19.0

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

func DecryptPkcs7 added in v0.19.0

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

func EncryptAesWithCbc added in v0.19.0

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

@param key 16字节 -> AES128

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

func EncryptPkcs5 added in v0.19.0

func EncryptPkcs5(in []byte) []byte

func EncryptPkcs7 added in v0.19.0

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

@param 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