crypto

package
v0.0.0-...-931a278 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 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)

@param key 16字节 -> AES128

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

func EncryptPkcs5

func EncryptPkcs5(in []byte) []byte

func EncryptPkcs7

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