33 lines
579 B
Plaintext
33 lines
579 B
Plaintext
![]() |
== How to fix it in .NET
|
||
|
|
||
|
=== Code examples
|
||
|
|
||
|
include::../../common/fix/code-rationale.adoc[]
|
||
|
|
||
|
==== Noncompliant code example
|
||
|
|
||
|
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
||
|
----
|
||
|
Imports System.Security.Cryptography
|
||
|
|
||
|
Public Sub Encrypt()
|
||
|
Dim SimpleDES As New DESCryptoServiceProvider() ' Noncompliant
|
||
|
End Sub
|
||
|
----
|
||
|
|
||
|
==== Compliant solution
|
||
|
|
||
|
[source,vbnet,diff-id=1,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[]
|
||
|
|