38 lines
851 B
Plaintext
Raw Normal View History

include::../description.adoc[]
== Noncompliant Code Example
https://nodejs.org/api/crypto.html[crypto] built-in module:
2022-02-04 17:28:24 +01:00
[source,javascript]
----
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:
2022-02-04 17:28:24 +01:00
[source,javascript]
----
crypto.createCipheriv("AES-256-GCM", key, iv);
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]