Author: muffin
Date: 2005-11-18 18:45:10 -0500 (Fri, 18 Nov 2005)
New Revision: 928
Added:
trunk/perl/client/bin/passcode.pl
Log:
Add a very short basic utility for coming up with passcodes, for testing
purposes and as an example.
Added: trunk/perl/client/bin/passcode.pl
===================================================================
--- trunk/perl/client/bin/passcode.pl 2005-11-18 23:24:32 UTC (rev 927)
+++ trunk/perl/client/bin/passcode.pl 2005-11-18 23:45:10 UTC (rev 928)
@@ -0,0 +1,35 @@
+# vim: set ft=perl ts=4 sw=4:
+# passcode.pl - generate a passcode for use in any Haver client according
+# to Haver::Spec::Auth.
+#
+# Copyright (C) 2005 Eric Goodwin.
+#
+# This module is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This module is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this module; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+use strict;
+
+use Digest::SHA1 qw( sha1_base64 );
+
+if (!defined $ARGV[2]) {
+ print "Usage: $0 <user> <host> <password>\n";
+ exit 0;
+}
+
+print "Passcode for $ARGV[0] on $ARGV[1] with password $ARGV[2] - ";
+print sha1_base64($ARGV[2] . lc("$ARGV[1]$ARGV[2]"))."\n";
+
+
+
+