forked from erdong01/crypto4go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaes_test.go
29 lines (28 loc) · 949 Bytes
/
aes_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package crypto4go
//import (
// "testing"
// "fmt"
// "encoding/hex"
//)
//
//var plain = "use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later."
//var key = "11111111111111111111111111111111"
//var iv = "1111111111111111"
//
//func Test_AES_CBC(t *testing.T) {
// var a = []byte(plain)
// var r, _ = AESCBCEncrypt(a, []byte(key), []byte(iv))
// fmt.Println("AES CBC Encrypt: ", hex.EncodeToString(r))
//
// r, _ = AESCBCDecrypt(r, []byte(key), []byte(iv))
// fmt.Println("AES CBC Decrypt: ", string(r))
//}
//
//func Test_AES_CFB(t *testing.T) {
// var a = []byte(plain)
// var r, _ = AESCFBEncrypt(a, []byte(key), []byte(iv))
// fmt.Println("AES CFB Encrypt: ", hex.EncodeToString(r))
//
// r, _ = AESCFBDecrypt(r, []byte(key), []byte(iv))
// fmt.Println("AES CFB Decrypt: ", string(r))
//}