2020-06-30 12:49:37 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
// === javax.crypto ===
|
|
|
|
import javax.crypto.Cipher;
|
|
|
|
Cipher c = Cipher.getInstance(...); // Sensitive
|
|
|
|
|
|
|
|
// === apache.commons.crypto ===
|
|
|
|
import java.util.Properties;
|
|
|
|
import org.apache.commons.crypto.utils.Utils;
|
|
|
|
import org.apache.commons.crypto.cipher.CryptoCipherFactory;
|
|
|
|
import org.apache.commons.crypto.cipher.CryptoCipherFactory.CipherProvider;
|
|
|
|
|
|
|
|
Properties properties = new Properties();
|
|
|
|
properties.setProperty(CryptoCipherFactory.CLASSES_KEY, CipherProvider.OPENSSL.getClassName());
|
|
|
|
final String transform = "AES/CBC/PKCS5Padding";
|
|
|
|
Utils.getCipherInstance(transform, properties); // Sensitive
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|