This commit is contained in:
Mrx
2026-06-10 19:05:49 +08:00
parent 533a07f077
commit 69d6377bc6
3 changed files with 7 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ import (
func TestAesEcbMobileEncryption(t *testing.T) {
// 测试手机号加密
mobile := "18653052547"
mobile := "18794854576"
key := []byte("ff83609b2b24fc73196aac3d3dfb874f") // 16字节AES-128密钥
keyStr := hex.EncodeToString(key)
@@ -19,7 +19,7 @@ func TestAesEcbMobileEncryption(t *testing.T) {
t.Fatalf("手机号加密失败: %v", err)
}
fmt.Printf("encrypted: %s\n", encrypted)
jmStr := "m9EEeW9ZBBJmi1hx1k1uIQ=="
jmStr := "hkRaxL8UeMfTveu12i0paQ=="
// 测试解密
decrypted, err := DecryptMobile(jmStr, keyStr)
if err != nil {