Mit der Methode ARGON2ID kann ich Passwörter in Python erzeugen und in PHP verifizieren oder in Python3 erzeugen und in PHP verifizieren.
Statt Anleitung: Mein Test
<?php
/**
*
* pip install argon2-cffi
* Python3:
* >>> from argon2 import PasswordHasher
* >>> PasswordHasher.hash("correct horse battery staple")
* '$argon2id$v=19$m=65536,t=3,p=4$FR1RjQI80l2wIZmZlIKQiQ$Rg7pZ/TtuInvJF31sr3BhvV47j10UeQIO01Rgp4P9OA'
*
* >>> PasswordHasher.verify(
* '$argon2id$v=19$m=65536,t=4,p=1$M0tXMmE4UVc1YzRwSmJEcQ$y/CeZ2oGrnj3ccgyFCZnl5oOqZilj6AI/5MK54HMDQQ',
* 'correct horse battery staple'
* )
* True
*/
if (
password_verify(
'correct horse battery staple',
'$argon2id$v=19$m=65536,t=3,p=4$FR1RjQI80l2wIZmZlIKQiQ$Rg7pZ/TtuInvJF31sr3BhvV47j10UeQIO01Rgp4P9OA'
)
) {
echo "Ja";
} else {
echo "Nein";
}
echo PHP_EOL;
echo password_hash('correct horse battery staple', PASSWORD_ARGON2ID);