encryptUtil

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(encrypted, key []byte) ([]byte, error)

func AESEncrypt

func AESEncrypt(plaintext []byte, key []byte) ([]byte, error)

func GenerateRsaKey

func GenerateRsaKey(len int) (string, string, error)

func MD5

func MD5(data []byte) string

MD5

func MD5File

func MD5File(filename string) string

获取文件的MD5

func ParsePrivateKey

func ParsePrivateKey(privateKeyStr string) (*rsa.PrivateKey, error)

将字符串转换为RSA私钥

func ParsePublicKey

func ParsePublicKey(publicKeyStr string) (*rsa.PublicKey, error)

func PrivateKeyToString

func PrivateKeyToString(privateKey *rsa.PrivateKey) (string, error)

func PublicKeyToString

func PublicKeyToString(publicKey *rsa.PublicKey) (string, error)

func RSADecrypt

func RSADecrypt(encryptedMsg, priKey string) (string, error)

func RSAEncrypt

func RSAEncrypt(message, pubKey string) (string, error)

func SHA256

func SHA256(data []byte) string

sha256

Types

This section is empty.

Jump to

Keyboard shortcuts

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