Is there a "simple" function in Delphi (using 10.3 Professional) that allows me to verify a password with a hash code generated in PHP using password_hash()
? A function which does the same as PHP's password_verify($password, $hash)
?
Example using PHP:
$hash = password_hash('thisismyaccesscode', PASSWORD_DEFAULT);
// $hash == '$2y$10$21qire0Qwz/gj6HEej3tf.skdiZzeB.rgFdg7qD.5rAhE/AFg.U8q'
Now I'm looking for a Delphi function, that tells me, if the password entered into my program can be verified against this hash.
Background: I have a list of user records for my web server. Using a web service I can retrieve a user's password hash from that server. I know it is generated using the PHP function password_hash()
. I want to enable my users to log in to my Delphi program using the access code from the web site. Therefore I get the password hash from the web server and want to verify it locally in my Delphi program instead of uploading the password to the server and checking with PHP.
source https://stackoverflow.com/questions/70364992/delphi-equivalent-to-phps-verify-password-function
Comments
Post a Comment