DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

Crypt::Rot13



NAME

Crypt::Rot13 v0.6 - a simple, reversible encryption


SYNOPSIS

  use Crypt::Rot13;
  my $rot13 = new Crypt::Rot13;
  $rot13->charge ("The quick brown fox jumped over the lazy dog.");
  print $rot13->rot13 (), "\n";
  print $rot13->rot13 (245.333), "\n";
  print $rot13->peek (), "\n";
  open (F, "/etc/passwd") or die "$!";
  $rot13->charge (<F>);
  close (F) or die "$!";
  print $rot13->rot13 (-13);
  while (<STDIN>) {
    $rot13->charge ($_);
    print $rot13->rot13 ();
  }
  $rot13->charge ('a' .. 'z');
  foreach (0 .. 26) {
    print $rot13->rot13 ($_), "\n";
  }


DESCRIPTION

rot13 is a simple encryption in which ASCII letters are rotated 13 places (see below). This module provides an array object with methods to encrypt its string elements by rotating ASCII letters n places down the alphabet.

Think of it this way: all of the letters of the alphabet are arranged in a circle like the numbers of a clock. Also like a clock, you have a hand pointing at one of the letters: a. Crypt::Rot13 turns the hand clockwise n times through 'b', 'c', 'd', etc, and back again to 'a', 26 turns later.

Crypt::Rot13 turns this hand for every letter of every string it contains a given number of times, the default of which is 13, or exactly half the number of letters in the alphabet.


PUBLIC METHODS

(In case you are wondering, the strange method names of peek and charge are derived from my original conception of Crypt::Rot13 as a magical device.)


LICENSE

Copyright (C) 1999-2000 Julian Fondren

This program 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 program 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 program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


BUGS

The algorithm of rot13 isn't very easy to understand.


AUTHOR

Julian Fondren


SEE ALSO

perl(1) rot13(1)