PeeHaa / OpCacheGUI

GUI for PHP's OpCache
1.46k stars 170 forks source link

CLI script to generate an encrypted password ? #67

Closed crazy-max closed 6 years ago

crazy-max commented 8 years ago

Hi!

Would be nice to implement a CLI script on project root to generate a password via input. Like this :

echo "Enter password to encrypt: ";
$password = trim(fgets(STDIN));

if (empty($password)) {
    echo 'ERROR: Password empty...';
    exit;
}

echo 'Encrypted password: ' . password_hash($argv[0], PASSWORD_BCRYPT, array("cost" => 12)) . "\n";

Usage : php pwd.php

Example :

Enter password to encrypt: test
Encrypted password: $2y$12$nGhWS7.zZ4Y2Zqnu4Tj7gePJOfX3R099hpXoqMPZ4XQmzRZbTsd6K
PeeHaa commented 6 years ago

Thanks! This is implemented in master https://github.com/PeeHaa/OpCacheGUI/commit/7631cba5d0ace07be4747dec8e19f65fcfc201c7