xcrypt

package
v0.0.0-...-80fcaa9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(str string) (string, error)

Base64Decode base64解密

func Base64Encode

func Base64Encode(str string) string

Base64Encode base64加密

func CRC32

func CRC32(data string) uint32

CRC32

func ECCDecrypt

func ECCDecrypt(ct []byte, prk ecies.PrivateKey) ([]byte, error)

func ECCEncrypt

func ECCEncrypt(pt []byte, puk ecies.PublicKey) ([]byte, error)

func GenRsaKeyWithPKCS1

func GenRsaKeyWithPKCS1(bits int) (pubkey, prikey string, err error)

GenRsaKeyWithPKCS1 RSA公钥私钥产生 PKCS1 公钥私钥 进行base64返回

func GenerateECCKey

func GenerateECCKey()

生成ECC椭圆曲线密钥对,保存到文件

func HashMod

func HashMod(str string, mod int64) (ret int64)

func HexDecodeStr

func HexDecodeStr(s string) (string, error)

hex.DecodeString(s string)//解密 hex.EncodeToString(src []byte) string//加密

解密

func HexEncodeStr

func HexEncodeStr(s string) string

加密

func MD5

func MD5(s string) string

MD5 对一个字符串进行MD5加密,不可解密

func RsaDecryptPKCS1v15

func RsaDecryptPKCS1v15(privateKey string, ciphertext []byte) ([]byte, error)

RsaDecryptPKCS1v15 解密

func RsaEncryptPKCS1v15

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

RsaEncryptPKCS1v15 加密

func RsaSignPKCS1v15WithSHA256

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

签名 对采用sha256算法 RsaSignPKCS1v15WithSHA256

func RsaVerfySignPKCS1v15WithSHA256

func RsaVerfySignPKCS1v15WithSHA256(originalData, signData []byte, pubKey string) error

验签:对采用sha256算法 RsaVerfySignPKCS1v15WithSHA256

func Sha1

func Sha1(s string) string

Sha1 获取 SHA1 字符串

func Sha256

func Sha256(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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