forked from Mxmilu666/frp
all: now messages between frps and frpc can be encryped when use_encryption set true
This commit is contained in:
@@ -19,10 +19,10 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEncrypto(t *testing.T) {
|
||||
func TestEncrypt(t *testing.T) {
|
||||
pp := new(Pcrypto)
|
||||
pp.Init([]byte("Hana"))
|
||||
res, err := pp.Encrypto([]byte("Just One Test!"))
|
||||
res, err := pp.Encrypt([]byte("Just One Test!"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -30,15 +30,15 @@ func TestEncrypto(t *testing.T) {
|
||||
fmt.Printf("[%x]\n", res)
|
||||
}
|
||||
|
||||
func TestDecrypto(t *testing.T) {
|
||||
func TestDecrypt(t *testing.T) {
|
||||
pp := new(Pcrypto)
|
||||
pp.Init([]byte("Hana"))
|
||||
res, err := pp.Encrypto([]byte("Just One Test!"))
|
||||
res, err := pp.Encrypt([]byte("Just One Test!"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
res, err = pp.Decrypto(res)
|
||||
res, err = pp.Decrypt(res)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user