crypto

package
v0.0.0-...-91aa13a Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

package crypto DES和3DES加解密

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES256CBCPKCS0Decrypt

func AES256CBCPKCS0Decrypt(src []byte, iv []byte, key []byte) ([]byte, error)

func AES256CBCPKCS0Encrypt

func AES256CBCPKCS0Encrypt(src []byte, iv []byte, key []byte) ([]byte, error)

func AESDecrypt

func AESDecrypt(src, key []byte) ([]byte, error)

AESDecrypt AES解密 初始向量16字节空 PKCS5 CBC 入参:src 已加密[]byte key:密钥[]byte 16/24/32 返回:解密后[]byte

func AESEncrypt

func AESEncrypt(src, key []byte) ([]byte, error)

AESEncrypt AES加密 初始向量16字节空 PKCS5 CBC 入参:src 待加密[]byte key:密钥[]byte 16/24/32 返回:加密后[]byte

func DESCBCPCSK5Decrypt

func DESCBCPCSK5Decrypt(key []byte, ciphertext []byte) ([]byte, error)

func DESCBCPCSK5Encrypt

func DESCBCPCSK5Encrypt(key []byte, plaintext []byte) ([]byte, error)

func PKCSPadding

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

func PKCSUnPadding

func PKCSUnPadding(origData []byte) []byte

func TripleDesECBDecrypt

func TripleDesECBDecrypt(crypted []byte, key string) ([]byte, error)

TripleDesECBDecrypt 3des解密

func TripleDesECBEncrypt

func TripleDesECBEncrypt(origData []byte, key string) ([]byte, error)

TripleDesECBEncrypt 3des加密 使用加密模式为ECB 填充方式为pkcs5 入参:待加密原始数据 字符串key 返回值:加密后的base64字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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