Skip to content

Instantly share code, notes, and snippets.

@pixelbrackets
Created September 7, 2021 13:12
Show Gist options
  • Save pixelbrackets/b0851a1dcb7e646978e622a252d4793f to your computer and use it in GitHub Desktop.
Save pixelbrackets/b0851a1dcb7e646978e622a252d4793f to your computer and use it in GitHub Desktop.
PHP Password Hash Creator
#!/usr/bin/env php
<?php
echo 'Password: ' . PHP_EOL;
fscanf(STDIN, '%s', $password);
$passwordHash = password_hash($password, PASSWORD_ARGON2I);
echo 'Hash: ' . PHP_EOL;
echo $passwordHash . PHP_EOL;
$result = password_verify($password, $passwordHash);
echo 'Verification: ' . PHP_EOL;
echo ($result) ? 'True': 'False';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment