Documentation ¶
Index ¶
- Variables
- func DecryptAES(key []byte, ct string) (string, error)
- func DecryptRSA(encrypted []byte, privateKey *rsa.PrivateKey) []byte
- func EncryptAES(key []byte, plaintext string) (string, error)
- func EncryptRSA(txt string) ([]byte, *rsa.PublicKey, *rsa.PrivateKey)
- func Md5(txt string) string
- func SaveRSAPrivateKey(private *rsa.PrivateKey)
- func SaveRSAPublicKey(public *rsa.PublicKey)
- func Sha2(txt string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AESIVKey = []byte("12345678901234567890123456789012") // 256位密钥
)
Functions ¶
func DecryptRSA ¶
func DecryptRSA(encrypted []byte, privateKey *rsa.PrivateKey) []byte
func EncryptRSA ¶
func SaveRSAPrivateKey ¶
func SaveRSAPrivateKey(private *rsa.PrivateKey)
func SaveRSAPublicKey ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.