Passwords

To create passwords for HTML-pages, there are several different methods:

htpasswd

htpasswd is a C-program, which is part of many HTTP-servers. It creates or modifies a text file with passwords for the server.

Create a new file

htpasswd -c MyFile MyName

A existing file will be overwritten!

Adding entries

htpasswd MyFile MyName

dbmmanage

dbmmanage works like htpasswd, but creates a database in DBM, DB or GDBM format, which is faster then a plaintext file and improves performance of the server. This program is a perl-script und requires the database modules for perl. The format has to match the format used my the Apache-db(m)-module. In some cases you have to change lines in dbmmanage to force perl to use the right format.

Adding users

dbmmanage adduser MyName
Prompts for a password and adds a new entry.
dbmmanage update MyName
Prompts for a password and changes an existing entry.

Deleting users

dbmmanage delete MyName
Deletes an entry from the database.

Importing a textfile

dbmmanage import < textFile
Imports a password file created by htpasswd with the format Username:Password:groups. The password has already to be encrypted by crypt(). Groups is an enumeration of groups, which is separated by commas.

Checking the database

dbmmanage check MyName
Prompts for a password and checks this with the one saved in the database.
dbmmanage view
Displays all entries in the database.

crypt()

The following programs read pairs of space separated usernames and passwords from STDIN and output encrypted entries for the password file.

C function

Download Sourcecode.

Perl function

Download Sourcecode.

Java Applet

Java Applet for crypt-function

Download applet sourcecode, sourcecode of ported crypt() function and java archive with all files.

JavaScript

Download Sourcecode.

Important: Only the first 8 characters are relevant. Upper- and lowercase letters are significant for usernames and passwords.