package crypter import ( "testing" ) func Test_TripleECBEncrypt(t *testing.T) { key := "7ejGP1WiZkgZ8VaIf6vBOBDFUnmByZiO" // 24字节的密钥 data := "这是测试 This is test!=" // 明文 d, err := TripleECBEncryptForHex(key, data) t.Log(d) t.Log(err) } func Test_TripleECBDecryptFromHex(t *testing.T) { key := "7ejGP1WiZkgZ8VaIf6vBOBDFUnmByZiO" // 24字节的密钥 key = "99ef199ddd11ff93d6927f755fd2b108" msg := "0a7d96e2459dfa37cd13b8611acb26dd9adf31016bdb93da0d25d6a8041005e6" msg = "AD2A27C86D0E6C0499BEEFDD60675129" data, err := TripleECBDecryptFromHex(key, msg) t.Log(data) t.Log(err) }