This plugin simplifies the life of WordPress users. Now you can easily create an htpasswd file to improve security of your site. Set and edit when you want a username and a password, decide whether to enable or not the protection and the plugin will create a .htpasswd file and also add the necessary code to .htaccess file.
You can read more on wordpress repository.