2020-06-30 14:41:58 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
|
|
|
----
|
2021-02-16 10:34:10 +01:00
|
|
|
$hash = md5($data); // Sensitive
|
|
|
|
$hash = sha1($data); // Sensitive
|
2020-06-30 14:41:58 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
2021-02-16 10:34:10 +01:00
|
|
|
// for a password
|
|
|
|
$hash = password_hash($password, PASSWORD_BCRYPT); // Compliant
|
|
|
|
|
|
|
|
// other context
|
|
|
|
$hash = hash("sha512", $data);
|
2020-06-30 14:41:58 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|