Static IV (ARCH8114)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key kotlin.security.static-iv · Severity error · Category security · CWE CWE-329
Flags IvParameterSpec / GCMParameterSpec built from a literal or a zero-filled array.
Incorrect
Section titled “Incorrect”IvParameterSpec(ByteArray(16))Correct
Section titled “Correct”val iv = ByteArray(12).also { SecureRandom().nextBytes(it) }GCMParameterSpec(128, iv)Generate a random IV/nonce per encryption and store it with the ciphertext.