How to create a htpasswd file with encrypted password?

htpasswd is used to create and update the flat files used to store usernames and passwords for basic authentication of HTTP users. Resources available from the Apache HTTP server can be restricted to just the users listed in the fi...]