Skip to content
jianmaikjPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

cred

常用加密:golang常用rsa/bcrypt/md5封装

demo

rsa := NewRSA()
//生成RSA密钥对
err := rsa.GenerateKey(1024)

//RSA加密
text := []byte("hello world")
encryptText, err := rsa.Encrypt(text,[]byte(publicKEY))
if err != nil {
  return 
}
//RSA解密
decryptText, _ := rsa.Decrypt(encryptText,[]byte(privateKEY))
fmt.Printf("encryptText:%s\ndecryptText:%s\n",encryptText,decryptText)
md5 := NewMd5()
//生成32位md5摘要
fmt.Println(md5.GetMd5HexDigest("hello world"))
//生成16位md5摘要
fmt.Println(md5.GetMd5HexDigest16("hello world"))

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages