mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 20:51:22 +08:00
u
This commit is contained in:
@@ -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)
|
||||
|
19
md5/md5.go
19
md5/md5.go
@@ -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)
|
||||
}
|
@@ -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
|
||||
|
||||
|
@@ -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 {
|
||||
|
||||
|
Reference in New Issue
Block a user