#!/usr/bin/perl use warnings; use strict; print "Standard crypt output\n"; print crypt("password","sa"), "\n"; #glibc's implementation that takes care of this. Since perl on # Linux uses glibc, you get this automagically. When the salt looks like # $1$...., it will encrypt the password using MD5. e.g. print "MD5 crypt output\n"; print crypt("password","\$1the_salt\$"), "\n"; print "SHA crypt output\n"; print crypt("password","\$2the_salt\$"), "\n";