MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / TestEncryptAES_DifferentNonces

Function TestEncryptAES_DifferentNonces

internal/crypto/aes_test.go:25–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestEncryptAES_DifferentNonces(t *testing.T) {
26 key := "test-key"
27 plaintext := "same-text"
28
29 enc1, err := EncryptAES(key, plaintext)
30 require.NoError(t, err)
31 enc2, err := EncryptAES(key, plaintext)
32 require.NoError(t, err)
33
34 // Same plaintext should produce different ciphertexts due to random nonce
35 assert.NotEqual(t, enc1, enc2)
36}
37
38func TestDecryptAES_TamperedCiphertext(t *testing.T) {
39 key := "test-key"

Callers

nothing calls this directly

Calls 1

EncryptAESFunction · 0.85

Tested by

no test coverage detected