v0.0.77
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package cryptext
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEncryptAESSimple(t *testing.T) {
|
||||
|
||||
@@ -8,15 +11,25 @@ func TestEncryptAESSimple(t *testing.T) {
|
||||
|
||||
str1 := []byte("Hello World")
|
||||
|
||||
str2, err := EncryptAESSimple(pw, str1)
|
||||
str2, err := EncryptAESSimple(pw, str1, 512)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf("%s\n", str2)
|
||||
|
||||
str3, err := DecryptAESSimple(pw, str2)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
assertEqual(t, string(str1), string(str3))
|
||||
|
||||
str4, err := EncryptAESSimple(pw, str3, 512)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
assertNotEqual(t, string(str2), string(str4))
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user