#!/usr/bin/perl # crypt.cgi by David Efflandt tech-ph@de-srv.com # last updated 2/3/00 # Crypts a password for use with web authentication # Modified to also work with older CGI.pm versions # that do not support tables (like v2.36) use CGI; $q = new CGI; srand( time() ^ ($$ + ($$ << 15))); print $q->header,$q->start_html('Crypt a Password'),"\n"; if ($q->param()) { $word = $q->param('word'); @range = ('0'..'9','a'..'z','A'..'Z','.','/'); $salt = $range[rand(int($#range)+1)] . $range[rand(int($#range)+1)]; $pass = crypt($word, $salt); print "
", "Example of a line in a password file for web authentication ". "(colon separated):
username:$pass
| ",
"Crypt a Plain Text Password ", qq( |
|---|