Crypt is a Joomla Platform class for handling basic encryption/decryption of data.
- Depuis
- 3.0.0
static timingSafeCompare |
( |
|
$known, |
|
|
|
$unknown |
|
) |
| |
|
static |
A timing safe comparison method.
This defeats hacking attempts that use timing based attack vectors.
NOTE: Length will leak.
- Paramètres
-
string | $known | A known string to check against. |
string | $unknown | An unknown string to check. |
- Renvoie
- boolean True if the two strings are exactly the same.
- Depuis
- 3.2
Explanation about the function_exists
Yes, hash_equals has existed since PHP 5.6.0 and Joomla's minimum requirements are higher than that. However, this does not prevent a misguided server administrator from disabling hash_equals in php.ini. Hence the need for checking whether the function exists or not.
If hash_equals is not available we use a pure PHP implementation by Anthony Ferrara.
- Voir également
- https://blog.ircmaxell.com/2014/11/its-all-about-time.html
Références $i, et $result.
Référencé par BackupcodesModel\isBackupCode(), Token\onUserAuthenticate(), et MD5Handler\validatePassword().