This commit is contained in:
kony
2025-09-22 16:19:18 +08:00
parent 5ee54c6166
commit b21b9d8828
4 changed files with 4 additions and 27 deletions

View File

@@ -6,7 +6,6 @@ import (
"crypto/cipher"
"encoding/base64"
"fmt"
"goodlink/md5"
)
func getKey(key string) []byte {
@@ -58,9 +57,6 @@ func Decrypt(cryted []byte, key string) []byte {
func AesTest() {
text := []byte("hello world")
temp0 := md5.Encode(string(text))
fmt.Printf("md5后: %s\n", temp0)
key := "1234567812345677777777777781238"
temp1 := Encrypt(text, key)
fmt.Printf("加密后: %s\n", temp1)

View File

@@ -1,19 +0,0 @@
package md5
import (
"crypto/md5"
"encoding/hex"
"fmt"
)
func Encode(data string) string {
h := md5.New()
h.Write([]byte(data))
return hex.EncodeToString(h.Sum(nil))
}
func EncodeTest() {
strTest := "I love this beautiful world!"
strEncrypted := "98b4fc4538115c4980a8b859ff3d27e1"
fmt.Println(Encode(strTest) == strEncrypted)
}

View File

@@ -2,8 +2,8 @@ package pro
import (
"errors"
"go2"
"goodlink/config"
"goodlink/md5"
"goodlink/netstack"
"goodlink/utils"
"goodlink2/tun"
@@ -152,7 +152,7 @@ func RunLocal(tun_key string) error {
m_local_state = 1
m_tun_key = tun_key
m_md5_tun_key = md5.Encode(tun_key)
m_md5_tun_key = go2.Md5Encode(tun_key)
count := 0

View File

@@ -1,8 +1,8 @@
package pro
import (
"go2"
"goodlink/config"
"goodlink/md5"
"goodlink/proxy"
"goodlink/utils"
"goodlink2/tun"
@@ -228,7 +228,7 @@ func RunRemote(tun_key string) error {
m_remote_stats = 1
m_tun_key = tun_key
m_md5_tun_key = md5.Encode(tun_key)
m_md5_tun_key = go2.Md5Encode(tun_key)
for m_remote_stats == 1 {