hash_equalsTiming attack safe string comparison Beschreibung
bool hash_equals
( string
$known_string
, string $user_string
)Compares two strings using the same time whether they're equal or not. This function should be used to mitigate timing attacks; for instance, when testing crypt password hashes. Parameter-Liste
Rückgabewerte
Returns Fehler/Exceptions
Emits an Beispiele
Beispiel #1 example
<?phpDas oben gezeigte Beispiel erzeugt folgende Ausgabe: bool(true) bool(false) Anmerkungen
|