MCPcopy Create free account
hub / github.com/devspace-sh/devspace / TestEncryptDecryptAES

Function TestEncryptDecryptAES

pkg/util/encryption/util_test.go:15–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13}
14
15func TestEncryptDecryptAES(t *testing.T) {
16 encrypted, err := EncryptAES([]byte("12345678901234567890123456789012"), []byte("Hello World"))
17 assert.NilError(t, err, "Error encrypting hello world")
18 decrypted, err := DecryptAES([]byte("12345678901234567890123456789012"), encrypted)
19 assert.NilError(t, err, "Error decrypting hello world")
20 assert.Equal(t, "Hello World", string(decrypted), "\"Hello World\" encrypted and decrypted is not \"Hello World\" anymore")
21}

Callers

nothing calls this directly

Calls 3

EncryptAESFunction · 0.85
DecryptAESFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected