Crypt-RS14_PP

 view release on metacpan or  search on metacpan

lib/Crypt/RS14_PP.pod  view on Meta::CPAN

# Generated by PerlDox 0.013

=head1 NAME


Crypt::RS14_PP - A pure Perl implementation of RS14, aka "Spritz", encryption algorithm.


=head4 Version

0.03

=head1 SYNOPSIS

    use Crypt::RS14_PP;

    my $key   = '16 to 64 bytes of key';
    my $rs14  = Crypt::RS14_PP->new($key);
    my $ctext = $rs14->encrypt('This is my plain text.');
    $rs14->set_key($key);
    my $ptext = $rs14->encrypt($ctext); # or decrypt as both do the same
    print "$ptext\n"; # prints 'This is my plain text.'

=head1 DESCRIPTION

RS14, aka "Spritz", is an encryption algorithm, proposed by Ron Rivist
and Jacob Schuldt, as a replacement for RC4, created by Ron Rivist.
RS14, like RC4, is a stream algorithm. It takes the basic concepts behind
RC4, enhancing and updating them for greater security.

Being pure Perl, this module is really just a testing tool. An XS or
Inline::C implementation will provide far better performance.

I<Note:> While this module's API is a superset of the Crypt:: API, the RS14
algorithm is not intended for use with Crypt::CBC or similar. By its
nature, it already operates in OFB (Output Feedback) mode.

I<Note:> Only the encrypt/decrypt capabilities of RS14 are implmented.

I<Note:> In this module, encrypt/decrypt use bitwise exclusive-or (C<^>) to
encipher/decipher the input, as this is commonly used in stream ciphers.
As a consequence, encrypt and decrypt are the same. Other operations are
possible. This not specified in the algorithm specification.

I<Note:> To encrypt "wide characters", such as Unicode, the character stream
B<must> be encoded into a byte stream before encrypting. (For Unicode, use
UTF-8 encoding.) Whatever encoding is used, security is enhanced by excluding
any byte order marks.

=head2 Class Methods


=head3 Function new

Creates a RS14 object and optionally sets the cryptographic key.


=head4 Parameter scalar $key

Key (optional - used for compatability with other Crypt:: modules)

=head2 Instance Methods


=head3 Function set_key

Sets the cryptographic key.


=head4 Parameter scalar $key

Key - 16 to N/4 bytes of key


=head3 Function encrypt

Encrypt (or decrypt) the given data bytes. (This function is identical to C<decrypt>.)



I<Note:>  Because this is a stream cipher, C<encrypt("ab") eq encrypt("a") . encrypt("b")>. To encrypt (or decrypt) 2 messages with same key, you must C<set_key($key)> before each message. Also, to encrypt and decrypt with same key, you must C<set_ke...


=head4 Parameter scalar $string

Byte string to encrypt or decrypt


=head3 Function decrypt

Decrypt (or encrypt) the given data bytes. (This function is identical to C<encrypt>.)

See L</encrypt>.

=head1 REFERENCES



( run in 1.399 second using v1.01-cache-2.11-cpan-e1769b4cff6 )