== How to fix it in Node.js

=== Code examples

==== Noncompliant code example

include::../../common/fix/aes-noncompliant-example.adoc[]

[source,javascript,diff-id=1,diff-type=noncompliant]
----
const crypto = require('crypto');

crypto.createCipheriv("AES-128-CBC", key, iv); // Noncompliant
----

==== Compliant solution

include::../../common/fix/aes-noncompliant-example.adoc[]

[source,javascript,diff-id=1,diff-type=compliant]
----
const crypto = require('crypto');

crypto.createCipheriv("AES-256-GCM", key, iv);
----

=== How does this work?

include::../../common/fix/fix.adoc[]
