MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestDecrypt_InvalidKey

Function TestDecrypt_InvalidKey

pkg/utils/crypto_test.go:245–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

243}
244
245func TestDecrypt_InvalidKey(t *testing.T) {
246 // First encrypt with a valid key
247 validKey := make([]byte, 32)
248 encrypted, err := Encrypt("test", validKey)
249 require.NoError(t, err)
250
251 // Try to decrypt with an invalid key length
252 _, err = Decrypt(encrypted, []byte{1, 2, 3})
253 assert.Error(t, err)
254}
255
256func TestDeriveKey_Deterministic(t *testing.T) {
257 // Same input should produce same output

Callers

nothing calls this directly

Calls 2

EncryptFunction · 0.85
DecryptFunction · 0.85

Tested by

no test coverage detected