== How to fix it in .NET

=== Code examples

include::../../common/fix/code-rationale.adoc[]

==== Noncompliant code example

[source,vbnet,diff-id=11,diff-type=noncompliant]
----
Imports System.Security.Cryptography

Public Sub Encrypt()
    Dim SimpleDES As New DESCryptoServiceProvider() ' Noncompliant
End Sub
----

==== Compliant solution

[source,vbnet,diff-id=11,diff-type=compliant]
----
Imports System.Security.Cryptography

Public Sub Encrypt()
    Dim AES128ECB = Aes.Create()
End Sub
----

=== How does this work?

include::../../common/fix/strong-cryptography.adoc[]

