This commit is contained in:
Mrx
2026-05-20 14:48:06 +08:00
parent 02cffff608
commit 063fb158c9
3 changed files with 661 additions and 484 deletions

View File

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