Use this form to generate your encrypted htaccess password.

<form method="post" action="">
	<p><input type="text" name="login" placeholder="Login" /></p>
	<p><input type="text" name="password" placeholder="Password" /></p>
	<p><input type="submit" value="Get" /></p>
</form>

<?PHP
// demo: http://tmp.itunix.eu/aLog.php
$login = $_POST['login'];
$password = $_POST['password'];
if ($password) {
    echo '<p>/var/www/.htpasswd</p>';
    echo '<code style="padding: 20px; background-color: #dedede;">';
    $encryptPassword = crypt($password, base64_encode($password));
    echo $login . ':' . $encryptPassword;
    echo '</code>';
?>
		<p>
			<br />
			<strong>.htaccess file</strong>
			<br />
			AuthName "Please give your password" <br />
			AuthType Basic <br />
			AuthUserFile /var/www/.htpasswd <br />
			Require valid-user <br />
		</p>
<?PHP
}
?>