goext/cryptext/aes_test.go
Mike Schwörer cb557cb319
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled
v0.0.572
2025-05-03 16:41:43 +02:00

37 lines
570 B
Go

package cryptext
import (
"fmt"
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
"testing"
)
func TestEncryptAESSimple(t *testing.T) {
pw := []byte("hunter12")
str1 := []byte("Hello World")
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)
}
tst.AssertEqual(t, string(str1), string(str3))
str4, err := EncryptAESSimple(pw, str3, 512)
if err != nil {
panic(err)
}
tst.AssertNotEqual(t, string(str2), string(str4))
}