#!/usr/bin/perl -w # # cram-md5.pl # ----------- # # Generate responses to CRAM-MD5 challenges for IMAP4 and SMTP authentication. # # See RFCs 2195 (CRAM-MD5), 1731 (IMAP AUTH) and 2554 (SMTP AUTH) # # $Id: cram-md5.pl,v 1.2 2004/01/28 12:03:46 tjd Exp $ # use strict; use Digest::HMAC_MD5 qw(hmac_md5_hex); use MIME::Base64; if ($#ARGV != 2) { print "Usage: $0 \n"; exit(1); } my ($challenge, $username, $password) = @ARGV; my $response = hmac_md5_hex(decode_base64($challenge), $password); print encode_base64("$username $response"); # # EOF (cram-md5.pl) #