vcrypto

package
v0.0.0-...-1671bb8 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOD_PKCS7 = 1
	MOD_PKCS5 = 2
	MOD_ZERO  = 3
)
View Source
const PKCS5_PADDING = "PKCS5"
View Source
const PKCS7_PADDING = "PKCS7"
View Source
const ZEROS_PADDING = "ZEROS"

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(encryptData, iv, key []byte) ([]byte, error)

AES 标准解密 encryptData 密文字节数组 iv 初始向量 key 密钥

func AESCBCDecryptDefault

func AESCBCDecryptDefault(cipherData []byte, aesKey []byte) ([]byte, error)

AESCBCDecryptDefault 标准AES解密

func AESCBCEncrypt

func AESCBCEncrypt(rawData, iv, key []byte) ([]byte, error)

========================================

AES-CBC加密算法(128位)

======================================== AES 标准加密 rawData 明文字节数组 iv 初始向量 key 密钥

func AESCBCEncryptDefault

func AESCBCEncryptDefault(plainData []byte, aesKey []byte) ([]byte, error)

AESCBCEncryptDefault 标准AES加密

func Base64DecodeBytes2String

func Base64DecodeBytes2String(src []byte) string

base64 标准加密

func Base64DecodeString2Bytes

func Base64DecodeString2Bytes(src string) (result []byte, err error)

base64 标准解密

func Base64DecodeString2String

func Base64DecodeString2String(src string) (string, error)

base64 标准解密

func Base64DecodeWithTable

func Base64DecodeWithTable(src []byte, base64table string) (dst []byte, err error)

base64 自定义码表解密返回byte

func Base64EncodeBytes2Bytes

func Base64EncodeBytes2Bytes(src []byte) (result []byte)

base64 标准加密

func Base64EncodeBytes2String

func Base64EncodeBytes2String(src []byte) string

base64 标准加密返回字符

func Base64EncodeString2Bytes

func Base64EncodeString2Bytes(src string) (result []byte)

base64 标准加密

func Base64EncodeString2String

func Base64EncodeString2String(src string) string

base64 标准加密返回字符

func CBCDecrypt

func CBCDecrypt(block cipher.Block, src, iv []byte, padding string) ([]byte, error)

CBCDecrypt

func CBCEncrypt

func CBCEncrypt(block cipher.Block, src, iv []byte, padding string) ([]byte, error)

CBCEncrypt

func DESDeCryptWithVI

func DESDeCryptWithVI(crypted, key, vi []byte) ([]byte, error)

DES解密算法

func DESDecrypt

func DESDecrypt(crypted, key, vi []byte, padmode int) ([]byte, error)

DES解密算法

func DESEnCryptWithVI

func DESEnCryptWithVI(origData, key, vi []byte) []byte

========================================

DES加密算法

========================================

func DESEncrypt

func DESEncrypt(origData, key, vi []byte, padmode int) ([]byte, error)

func HmacSha1Byte

func HmacSha1Byte(key, data []byte) []byte

HMAC生成字节

func HmacSha1String

func HmacSha1String(key, data string) string

HMAC生成字符串

func MD5

func MD5(s string) string

MD5标准算法

func PKCS5Padding

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

func PKCS5Unpadding

func PKCS5Unpadding(src []byte) []byte

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

使用PKCS7进行补码

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

使用PKCS7进行去补码

func Padding

func Padding(padding string, src []byte, blockSize int) []byte

func SHA1

func SHA1(key, data string) string

SHA1 自定义密钥算法

func SHA1Default

func SHA1Default(s string) string

SHA1标准算法

func ThriDESDecrypt

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

3DES解密算法

func ThriDESEncrypt

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

========================================

3DES加密算法

========================================

func UnPadding

func UnPadding(padding string, src []byte) []byte

func ZerosPadding

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

func ZerosUnPadding

func ZerosUnPadding(src []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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