AsymCrypt optimize + Symcrypt creation

This commit is contained in:
ycc
2022-09-18 21:17:28 +02:00
parent 01aec23f76
commit 35fa29f5b9
9 changed files with 199 additions and 22 deletions

21
symcrypt_test.go Normal file
View File

@ -0,0 +1,21 @@
package meowlib
import (
"log"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSymEncryptDecrypt(t *testing.T) {
foo := []byte("!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~")
encMess, err := SymEncrypt("mysecretpassword", foo)
if err != nil {
log.Println(err.Error())
}
decMess, err2 := SymDecrypt("mysecretpassword", encMess)
if err2 != nil {
log.Println(err2.Error())
}
assert.Equal(t, foo, decMess, "The two messages should be the same.")
}