Files
go-easy-utils/cryptoUtil/README.md
T
2024-06-20 16:55:23 +08:00

610 B

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)