This commit is contained in:
2023-02-03 00:59:54 +01:00
parent 36ed474bfe
commit be4de07eb8
4 changed files with 147 additions and 38 deletions

View File

@@ -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))
}