From a980fe1e9e1ba3257ba9e924ab751cf1b8aea327 Mon Sep 17 00:00:00 2001 From: loshiqi <553578653@qq.com> Date: Wed, 5 Mar 2025 15:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aes_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aes_test.go b/aes_test.go index 8d04621..3d0c653 100644 --- a/aes_test.go +++ b/aes_test.go @@ -7,12 +7,13 @@ import ( func Test_EncryptAES(t *testing.T) { // 要加密的明文 - str := `{"open_id":"op2kh5PTc2-4u3XaADjjbkxeXPn0","userName":"山野雾灯"}` + //str := `{"open_id":"op2kh5PTc2-4u3XaADjjbkxeXPn0","userName":"山野雾灯"}` // 密钥,AES 支持 16、24 或 32 字节的密钥 - key := "0123456789abcdef0123456789abcdef" - ret, err := EncryptAES(str, key) + key := "0123456789shopef0123456789shopef" + /*ret, err := EncryptAES(str, key) t.Log(err) - t.Log(ret) + t.Log(ret)*/ + ret := "jpWI1PWjg9GKmSMRv8WiuL4CI/vZG3xgTfOiLrbY8ZK+T8poUgK7fFPkj7H2tGSHbB1A/ucOjjSwEvbQDYZfOw==" res, err := DecryptAES(ret, key) t.Log(err) t.Log(string(res))