encrypt

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHAR_SET               = "UTF-8"
	BASE_64_FORMAT         = "UrlSafeNoPadding"
	RSA_ALGORITHM_KEY_TYPE = "PKCS8"
	RSA_ALGORITHM_SIGN     = crypto.SHA256
)

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func Decrypt3Des added in v0.2.5

func Decrypt3Des(enStr string, key string) (string, error)

解密字符串

func Encrypt3Des added in v0.2.5

func Encrypt3Des(src string, key string) (string, error)

加密字符串

func HashPassword

func HashPassword(password string) (string, error)

func Md5FileSum added in v0.2.5

func Md5FileSum(filepath string) (string, error)

func Md5ParamSign added in v0.2.5

func Md5ParamSign(paramMap map[string]interface{}, appKey string, appVal string, secretKey, secretVal string) string

md5参数加签,返回加签后的md5字符串 paramMap 待校验参数 appKey 应用的appkey的名称 appVal 应用的appkey的值 secretKey 应用的secretkey的名称 secretVal 应用的secretkey的值

func RSAKeyGen

func RSAKeyGen(bits int) (string, string, error)

返回生成的私钥、公钥对

func RsaPrivateDecrypt

func RsaPrivateDecrypt(privateKey []byte, encrypted []byte) ([]byte, error)

私钥解密

func RsaPrivateSign

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

私钥数据加签

func RsaPubVerifySign

func RsaPubVerifySign(pubKey []byte, data string, sign string) error

公钥数据验签

func RsaPublicEncrypt

func RsaPublicEncrypt(pubKey []byte, data []byte) ([]byte, error)

公钥加密

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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