Fastest way to generate passwords for htpasswd

The fastest way of generating passwords for htpasswd program is… to use PHP for this task:

$clearTextPassword = 'some password';
$password = crypt($clearTextPassword, base64_encode($clearTextPassword));

echo $password;

You may also (of course!) use htpasswd program or some 3rd party tools.

Leave a Reply