crypt

package
v0.0.0-...-3fc60fe Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 18 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, iv []byte) ([]byte, error)

aes cbc解密

func AesEncrypt

func AesEncrypt(origData, key, iv []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 EncryptPKCS1v15

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

rsa公钥加密

func HmacEncrypt

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

func HmacEncryptToBase64

func HmacEncryptToBase64(origData, key []byte, hash crypto.Hash) 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 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