r21225 - in /branches/upstream/libdigest-bubblebabble-perl: ./ current/ current/BubbleBabble.pm current/Changes current/MANIFEST current/Makefile.PL current/README current/test.pl

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sun Jun 15 13:41:15 UTC 2008


Author: gregoa
Date: Sun Jun 15 13:41:15 2008
New Revision: 21225

URL: http://svn.debian.org/wsvn/?sc=1&rev=21225
Log:
[svn-inject] Installing original source of libdigest-bubblebabble-perl

Added:
    branches/upstream/libdigest-bubblebabble-perl/
    branches/upstream/libdigest-bubblebabble-perl/current/
    branches/upstream/libdigest-bubblebabble-perl/current/BubbleBabble.pm
    branches/upstream/libdigest-bubblebabble-perl/current/Changes
    branches/upstream/libdigest-bubblebabble-perl/current/MANIFEST
    branches/upstream/libdigest-bubblebabble-perl/current/Makefile.PL
    branches/upstream/libdigest-bubblebabble-perl/current/README
    branches/upstream/libdigest-bubblebabble-perl/current/test.pl

Added: branches/upstream/libdigest-bubblebabble-perl/current/BubbleBabble.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/BubbleBabble.pm?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/BubbleBabble.pm (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/BubbleBabble.pm Sun Jun 15 13:41:15 2008
@@ -1,0 +1,105 @@
+package Digest::BubbleBabble;
+use strict;
+
+use Exporter;
+use vars qw( @EXPORT_OK @ISA $VERSION );
+ at ISA = qw( Exporter );
+ at EXPORT_OK = qw( bubblebabble );
+
+$VERSION = '0.01';
+
+use vars qw( @VOWELS @CONSONANTS );
+ at VOWELS = qw( a e i o u y );
+ at CONSONANTS = qw( b c d f g h k l m n p r s t v z x );
+
+sub bubblebabble {
+    my %param = @_;
+    my @dgst = map ord, split //, $param{Digest};
+    my $dlen = length $param{Digest};
+
+    my $seed = 1;
+    my $rounds = ($dlen / 2) + 1;
+    my $retval = 'x';
+    for my $i (0..$rounds-1) {
+        if ($i+1 < $rounds || $dlen % 2) {
+            my $idx0 = ((($dgst[2 * $i] >> 6) & 3) + $seed) % 6;
+            my $idx1 = ($dgst[2 * $i] >> 2) & 15;
+            my $idx2 = (($dgst[2 * $i] & 3) + $seed / 6) % 6;
+            $retval .= $VOWELS[$idx0] . $CONSONANTS[$idx1] . $VOWELS[$idx2];
+            if ($i+1 < $rounds) {
+                my $idx3 = ($dgst[2 * $i + 1] >> 4) & 15;
+                my $idx4 = $dgst[2 * $i + 1] & 15;
+                $retval .= $CONSONANTS[$idx3] . '-' . $CONSONANTS[$idx4];
+                $seed = ($seed * 5 + $dgst[2 * $i] * 7 +
+                        $dgst[2 * $i + 1]) % 36;
+            }
+        }
+        else {
+            my $idx0 = $seed % 6;
+            my $idx1 = 16;
+            my $idx2 = $seed / 6;
+            $retval .= $VOWELS[$idx0] . $CONSONANTS[$idx1] . $VOWELS[$idx2];
+        }
+    }
+    $retval .= 'x';
+    $retval;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Digest::BubbleBabble - Create bubble-babble fingerprints
+
+=head1 SYNOPSIS
+
+    use Digest::BubbleBabble qw( bubblebabble );
+    use Digest::SHA1 qw( sha1 );
+
+    my $fingerprint = bubblebabble( Digest => sha1($message) );
+
+=head1 DESCRIPTION
+
+I<Digest::BubbleBabble> takes a message digest (generated by
+either of the MD5 or SHA-1 message digest algorithms) and creates
+a fingerprint of that digest in "bubble babble" format.
+Bubble babble is a method of representing a message digest
+as a string of "real" words, to make the fingerprint easier
+to remember. The "words" are not necessarily real words, but
+they look more like words than a string of hex characters.
+
+Bubble babble fingerprinting is used by the SSH2 suite
+(and, consequently, by I<Net::SSH::Perl>, the Perl SSH
+implementation) to display easy-to-remember key fingerprints.
+The key (a DSA or RSA key) is converted into a textual form,
+digested using I<Digest::SHA1>, and run through I<bubblebabble>
+to create the key fingerprint.
+
+=head1 USAGE
+
+I<Digest::BubbleBabble> conditionally exports one function called
+I<bubblebabble>; to import the function you must choose to
+import it, like this:
+
+    use Digest::BubbleBabble qw( bubblebabble );
+
+=head2 bubblebabble( Digest => $digest )
+
+Currently takes only one pair of arguments, the key of
+which must be I<Digest>, the value of which is the actual
+message digest I<$digest>. You should generate this message
+digest yourself using either I<Digest::MD5> of I<Digest::SHA1>.
+
+Returns the bubble babble form of the digest.
+
+=head1 AUTHOR & COPYRIGHTS
+
+Benjamin Trott, ben at rhumba.pair.com
+
+Except where otherwise noted, Digest::BubbleBabble is Copyright
+2001 Benjamin Trott. All rights reserved. Digest::BubbleBabble is
+free software; you may redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut

Added: branches/upstream/libdigest-bubblebabble-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/Changes?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/Changes (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/Changes Sun Jun 15 13:41:15 2008
@@ -1,0 +1,6 @@
+$Id: Changes,v 1.2 2001/05/03 01:15:20 btrott Exp $
+
+Revision history for Digest::BubbleBabble
+
+0.01 2001.05.02
+    - original version; created by h2xs 1.19

Added: branches/upstream/libdigest-bubblebabble-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/MANIFEST?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/MANIFEST (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/MANIFEST Sun Jun 15 13:41:15 2008
@@ -1,0 +1,6 @@
+BubbleBabble.pm
+Changes
+MANIFEST
+Makefile.PL
+README
+test.pl

Added: branches/upstream/libdigest-bubblebabble-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/Makefile.PL?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/Makefile.PL (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/Makefile.PL Sun Jun 15 13:41:15 2008
@@ -1,0 +1,11 @@
+# $Id: Makefile.PL,v 1.1.1.1 2001/05/03 01:11:11 btrott Exp $
+
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME => 'Digest::BubbleBabble',
+    DISTNAME => 'Digest-BubbleBabble',
+    VERSION_FROM => 'BubbleBabble.pm',
+    AUTHOR => 'Benjamin Trott <ben at rhumba.pair.com>',
+    ABSTRACT => 'Create bubble-babble fingerprints',
+);

Added: branches/upstream/libdigest-bubblebabble-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/README?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/README (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/README Sun Jun 15 13:41:15 2008
@@ -1,0 +1,30 @@
+$Id: README,v 1.2 2001/05/03 01:15:20 btrott Exp $
+
+This is Digest::BubbleBabble.
+
+PREREQUISITES
+
+None.
+
+INSTALLATION
+
+Digest::BubbleBabble installation is straightforward. If your
+cpan shell is set up, you should just be able to do
+
+    % perl -MCPAN -e 'install Digest::BubbleBabble'
+
+If you don't like that, you can download the distribution; the
+latest version on CPAN can be found in
+
+    ftp://ftp.cpan.org/pub/CPAN/authors/id/B/BT/BTROTT/
+
+Download it, unpack it, then build it as per the usual:
+
+    % perl Makefile.PL
+    % make && make test
+
+Then install it:
+
+    % make install
+
+Benjamin Trott / ben at rhumba.pair.com

Added: branches/upstream/libdigest-bubblebabble-perl/current/test.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libdigest-bubblebabble-perl/current/test.pl?rev=21225&op=file
==============================================================================
--- branches/upstream/libdigest-bubblebabble-perl/current/test.pl (added)
+++ branches/upstream/libdigest-bubblebabble-perl/current/test.pl Sun Jun 15 13:41:15 2008
@@ -1,0 +1,19 @@
+# $Id: test.pl,v 1.4 2001/05/03 01:28:08 btrott Exp $
+
+use strict;
+
+use Test;
+BEGIN { plan tests => 3 }
+
+use vars qw( $loaded );
+END { print "not ok 1\n" unless $loaded; }
+use Digest::BubbleBabble qw( bubblebabble );
+$loaded++;
+ok($loaded);
+
+ok(defined &bubblebabble);
+
+my $dgst = pack "H*", "0a86c1b0428a6ce8103dfcc666519ae2918655d8";
+my $bb = "xedim-kibyr-bybum-poryv-migyf-tazes-kunah-cikev-dugom-kihat-maxyx";
+
+ok(bubblebabble( Digest => $dgst ), $bb);




More information about the Pkg-perl-cvs-commits mailing list