优化整体

This commit is contained in:
hoteas
2022-03-13 01:48:54 +08:00
parent ac027c6e42
commit 8befd195c0
22 changed files with 312 additions and 289 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ func FileGet(path string) []byte {
return buf
}
//RSA加密
// RSA_Encrypt RSA加密
// plainText 要加密的数据
// path 公钥匙文件地址
func RSA_Encrypt(plainText []byte, buf []byte) []byte {
@@ -46,7 +46,7 @@ func RSA_Encrypt(plainText []byte, buf []byte) []byte {
return cipherText
}
//RSA解密
// RSA_Decrypt RSA解密
// cipherText 需要解密的byte数据
// path 私钥文件路径
func RSA_Decrypt(cipherText []byte, buf []byte) []byte {
@@ -97,7 +97,7 @@ func Demo() {
fmt.Println(string(decrypt))
}
//生成RSA私钥和公钥,保存到文件中
// GenerateRSAKey 生成RSA私钥和公钥,保存到文件中
// bits 证书大小
func GenerateRSAKey(bits int, path string) {
//GenerateKey函数使用随机数据生成器random生成一对具有指定字位数的RSA密钥