Files
goEncrypt/aes/aesecb_test.go
songguangyang 661395ac73 modify some
2022-07-07 16:34:33 +08:00

19 lines
379 B
Go

package aes
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestAesEcb(t *testing.T) {
var (
key = "1234567812345678"
plaintext = "TestAesEcb"
)
cipherBytes, err := AesEcbEncrypt([]byte(plaintext),[]byte(key))
assert.Nil(t, err)
text, err := AesEcbDecrypt(cipherBytes,[]byte(key))
assert.Nil(t, err)
assert.Equal(t, string(text), plaintext)
}