28 lines
713 B
Plaintext
Raw Normal View History

include::../description.adoc[]
== Noncompliant Code Example
https://nodejs.org/api/crypto.html[crypto] built-in module:
----
crypto.createCipheriv("AES-128-CBC", key, iv); // Noncompliant: CBC with PKCS5/7 (set by default) is vulnerable to oracle padding attacks
crypto.createCipheriv("AES-128-ECB", key, ""); // Noncompliant: ECB doesn't provide serious message confidentiality
----
== Compliant Solution
https://nodejs.org/api/crypto.html[crypto] built-in module:
----
crypto.createCipheriv("AES-256-GCM", key, iv);
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]