Files
go-easy-utils/cryptoUtil
2024-07-31 19:51:01 +08:00
..
2024-07-31 19:51:01 +08:00
2023-03-21 08:26:17 +08:00
2023-04-12 15:09:44 +08:00
2024-07-31 19:51:01 +08:00
2023-04-03 13:22:48 +08:00
2024-07-31 19:51:01 +08:00
2024-03-15 13:00:19 +08:00
2024-07-13 16:27:30 +08:00

cryptoUtil

Install

go get -u github.com/jefferyjob/go-easy-utils/v2/cryptoUtil

Import

import (
	"github.com/jefferyjob/go-easy-utils/v2/cryptoUtil"
)

Functions

// HashSHA256 hash加密
func HashSHA256(str string) string

// Md5 MD5加密
func Md5(str string) string

// GenerateRSAKeys 生成RSA私钥和公钥
func GenerateRSAKeys() (string, string, error)

// EncryptRSA RSA加密数据
func EncryptRSA(publicKeyStr string, message []byte) ([]byte, error)

// DecryptRSA RSA解密数据
func DecryptRSA(privateKeyStr string, ciphertext []byte) ([]byte, error)