gcrypto

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecryptCBC

func AesDecryptCBC(key, src []byte) (data []byte, err error)

AesDecryptCBC aes解密

func AesDecryptCFB

func AesDecryptCFB(key, encrypted []byte) (decrypted []byte)

AesDecryptCFB aes解密

func AesDecryptECB

func AesDecryptECB(key, encrypted []byte) (decrypted []byte)

AesDecryptECB aes解密

func AesEncryptCBC

func AesEncryptCBC(key, src []byte) (data []byte, err error)

AesEncryptCBC aes加密

func AesEncryptCFB

func AesEncryptCFB(key, origData []byte) (encrypted []byte)

AesEncryptCFB aes加密

func AesEncryptECB

func AesEncryptECB(key, origData []byte) (encrypted []byte)

AesEncryptECB aes加密

func CreateKeyX509PKCS1

func CreateKeyX509PKCS1(bits int) (pub string, pri string)

func DecryptDataByAes

func DecryptDataByAes(key, data string) ([]byte, error)

DecryptDataByAes base64解码后 Aes 解密

func EncryptDataByAes

func EncryptDataByAes(key string, data []byte) (string, error)

EncryptDataByAes Aes加密后base64

func Md5

func Md5(str string) string

Md5 32位md5加密后字符串

func Md5SaltMulti

func Md5SaltMulti(str string, salt string, iteration int) string

Md5SaltMulti 加盐并多次加密

func Md5To16

func Md5To16(str string) string

Md5To16 16位md5加密后字符串

func Md5WithSalt

func Md5WithSalt(str string, salt string) string

Md5WithSalt 加盐加密

func PrivateKeyFromX509PKCS1

func PrivateKeyFromX509PKCS1(pri string) (*rsa.PrivateKey, error)

func PublicKeyFromX509PKCS1

func PublicKeyFromX509PKCS1(pub string) (*rsa.PublicKey, error)

func RsaDecrypt

func RsaDecrypt(key *rsa.PrivateKey, src []byte) (data []byte, err error)

func RsaEncrypt

func RsaEncrypt(key *rsa.PublicKey, src []byte) (data []byte, err error)

func Sign

func Sign(key *rsa.PrivateKey, src []byte) (sign []byte, err error)

func Verify

func Verify(key *rsa.PublicKey, sign, src []byte) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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