cryptoutil

package
v0.0.0-...-0b59520 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOPADDING = iota
	PKCS5PADDING
)

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(key, crypted []byte) ([]byte, error)

AesDecrypt AES 解密

func AesEncrypt

func AesEncrypt(key, origData []byte) ([]byte, error)

AesEncrypt AES 加密

func DesCBCDecrypt

func DesCBCDecrypt(key []byte, cipherText []byte, iv []byte, padding int) ([]byte, error)

CBC模式DES解密

func DesCBCEncrypt

func DesCBCEncrypt(key []byte, clearText []byte, iv []byte, padding int) ([]byte, error)

CBC模式DES加密

func DesECBDecrypt

func DesECBDecrypt(key []byte, cipherText []byte, padding int) ([]byte, error)

ECB模式DES解密

func DesECBEncrypt

func DesECBEncrypt(key []byte, clearText []byte, padding int) ([]byte, error)

ECB模式DES加密

func PKCSPadding

func PKCSPadding(text []byte, blockSize int) []byte

PKCS5补位

func PKCSUnPadding

func PKCSUnPadding(text []byte) []byte

去除PKCS5补位

func Padding

func Padding(text []byte, padding int) ([]byte, error)

补位方法

func TripleDesCBCDecrypt

func TripleDesCBCDecrypt(key []byte, cipherText []byte, iv []byte, padding int) ([]byte, error)

CBC模式3DES解密

func TripleDesCBCEncrypt

func TripleDesCBCEncrypt(key []byte, clearText []byte, iv []byte, padding int) ([]byte, error)

CBC模式3DES加密

func TripleDesECBDecrypt

func TripleDesECBDecrypt(key []byte, cipherText []byte, padding int) ([]byte, error)

ECB模式3DES解密,密钥长度可以是16或24位长

func TripleDesECBEncrypt

func TripleDesECBEncrypt(key []byte, clearText []byte, padding int) ([]byte, error)

ECB模式3DES加密,密钥长度可以是16或24位长

func UnPadding

func UnPadding(text []byte, padding int) ([]byte, error)

去除补位方法

Types

This section is empty.

Jump to

Keyboard shortcuts

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