crypt

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCTREncrypt

func AesCTREncrypt(origData, key, iv []byte) ([]byte, error)

aes ctr加密

func AesDecrypt

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

aes cbc解密

func AesEncrypt

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

aes cbc加密

func DecryptRSA

func DecryptRSA(data, privateKey []byte) (string, error)

DecryptRSA decrypt given []byte with RSA algorithm

func DesEncrypt

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

func DesEncrypt1

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

Des加密

func Encrypt

func Encrypt(origData, key []byte, hash crypto.Hash) string

func EncryptPKCS1v15

func EncryptPKCS1v15(origData, publicKey []byte) (string, error)

rsa公钥加密

func GetAesKey

func GetAesKey() []byte

func HmacSha256EncryptToBase64

func HmacSha256EncryptToBase64(origData, key []byte) string

func LLEncrypt

func LLEncrypt(plaintext, public_key []byte) string

func MD5

func MD5(data string) string

md5加密

func MD5Encrypt16

func MD5Encrypt16(data string) string

md5加密16位

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func RsaDecryptNew

func RsaDecryptNew(ciphertext, privateKey []byte) ([]byte, error)

func RsaEncrypt

func RsaEncrypt(origData, publicKey []byte) (string, error)

func SignPKCS1v15

func SignPKCS1v15(origData, privateKey []byte, hash crypto.Hash) (string, error)

rsa 签名

func VerifyPKCS1v15

func VerifyPKCS1v15(origData, signedData, publicKey []byte, hash crypto.Hash) error

rsa 验签

func ZeroPadding

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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