23 lines
334 B
Go
23 lines
334 B
Go
|
package cryptext
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestEncryptAESSimple(t *testing.T) {
|
||
|
|
||
|
pw := []byte("hunter12")
|
||
|
|
||
|
str1 := []byte("Hello World")
|
||
|
|
||
|
str2, err := EncryptAESSimple(pw, str1)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
str3, err := DecryptAESSimple(pw, str2)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
assertEqual(t, string(str1), string(str3))
|
||
|
}
|