From 4429072e0c7669a8fd3ec8810544eaa8ada73988 Mon Sep 17 00:00:00 2001 From: ZhuoQinghui <1302344380@qq.com> Date: Thu, 31 Oct 2024 10:45:46 +0800 Subject: [PATCH] list --- src/http.go | 5 +++-- test/encrypt_test.go | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/http.go b/src/http.go index a5a533d..6763346 100644 --- a/src/http.go +++ b/src/http.go @@ -35,10 +35,11 @@ func domainList(c *gin.Context) { log.Fatal(err) } + encryptData := encryptResult(string(data), token) c.JSON(200, gin.H{ "code": 200, - "msg": "Success", - "data": encryptResult(string(data), token), + "msg": "success", + "data": encryptData, }) } diff --git a/test/encrypt_test.go b/test/encrypt_test.go index 4896100..64eec29 100644 --- a/test/encrypt_test.go +++ b/test/encrypt_test.go @@ -61,3 +61,12 @@ func TestRSA(t *testing.T) { fmt.Println(string(decryptd)) } + +func TestAES(t *testing.T) { + content := "123456" + encryptd := crypto.EncryptAES([]byte("12345678901234561234567890123456"), []byte(content)) + fmt.Println(base64.StdEncoding.EncodeToString(encryptd)) + plain := crypto.DecryptAES([]byte("12345678901234561234567890123456"), encryptd) + fmt.Println(string(plain)) + +}