package crypter import ( "fmt" "testing" ) //func Test_DesEncrypt(t *testing.T) { // str := "123456789" // key := "DBPHW3K9" // ret, err := DesEncrypt(str, key) // fmt.Println(ret) // fmt.Println(err) //} //func Test_DesDecrypt(t *testing.T) { // str := "54291b8fa850aca3fb102569e569718797" // key := "DBPHW3K9" // ret, err := DesDecrypt(str, key) // fmt.Println("ret:", ret) // fmt.Println(err) //} //func Test_DesEn(t *testing.T) { // str := "rdesktop 10.0.66.21 -f -u username" // key := "2boscl0z" // en := DesEn(str, key) // fmt.Println(en) // fmt.Println(str) //} //func Test_DesDe(t *testing.T) { // str := "CD3A229D828AC38784064B2A1CCDEAD803D859DE60B20AE4FE81D27F59B64D39E3D09545EFDAFBB644C779872E1EB86B14742FE6A267D69AFD5888256F9D11D6D86EAECBCB2F0475E83432721DEF3BC60393C382F74B8BB7" // fmt.Println(str) // key := "LD13EY1R" // de := DesDe(str, key) // fmt.Println(" 数据 :", de) //} //func Test_TripleDesEncrypt(t *testing.T) { // // DogKey := "FP4FSSJ5" // // key := DogKey + "gi$01Lzy" + DogKey // kenEncode, err := TripleDesEncrypt("control-hdraydesktop") // t.Log(kenEncode) // t.Log(err) //} func Test_TripleDesDecrypt(t *testing.T) { str := "7fXpywgiF25K" DogKey := "FP4FSSJ5" key := DogKey + "gi$01Lzy" + DogKey de, err := TripleDesDecrypt(str, key) //, "8JTE41BA8JTE41BA8JTE41BA" fmt.Println(de, err) t.Log(de) de, err = TripleDesDecrypt("n7BCRSXtDUKv/RwRgu1s7j/FRg3v+TG9UFEqx7f+BPTuhl0Nm3GMRxbh/8JDxVH0zwJoQZOLUtnBkuchs2EaM9qNVLpIjF4fsoKMerlCbc1PY4mTKNdszzyTG31Nq/a0yrPrxInzsEBej8zrBLXBY0Ub7fO/aPQSxcEoTXK2/NmJI2r6y/LXfnmUeQ5/nBQuAOkP94mjVvyJi40wqGb0f7ae8Y3PoDONmM1JbGNVl0R0LMLQtLcqK914Ls8YQY3OZRBGmZtRQ5ZDbqyXCBCl6igsuZzmN+q8FyXjyzeAdWtlvbQtW1FROFNXXS3qExYx2a137l+szQGfWUpYvP9Egdx2YixxsIrZNEjQQVQzJkM=") //, "8JTE41BA8JTE41BA8JTE41BA" fmt.Println(de, err) } //func Test_Md5Password(t *testing.T) { // str := "123456" // one := Md5Password(str, "") // fmt.Println("md5 123456", one) //}