Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Crypt::Stream::Salsa20

Name Crypt::Stream::Salsa20
Version 0.076
Located at /usr/lib/x86_64-linux-gnu/perl5/5.34
File /usr/lib/x86_64-linux-gnu/perl5/5.34/Crypt/Stream/Salsa20.pm
Is Core No
Search CPAN for this module Crypt::Stream::Salsa20
Documentation Crypt::Stream::Salsa20
Module Details Crypt::Stream::Salsa20


NAME

Crypt::Stream::Salsa20 - Stream cipher Salsa20


SYNOPSIS

   use Crypt::Stream::Salsa20;
   # encrypt
   $key = "1234567890123456";
   $iv  = "12345678";
   $stream = Crypt::Stream::Salsa20->new($key, $iv);
   $ct = $stream->crypt("plain message");
   # decrypt
   $key = "1234567890123456";
   $iv  = "12345678";
   $stream = Crypt::Stream::Salsa20->new($key, $iv);
   $pt = $stream->crypt($ct);


DESCRIPTION

Provides an interface to the Salsa20 stream cipher.


METHODS

new

 $stream = Crypt::Stream::Salsa20->new($key, $iv);
 #or
 $stream = Crypt::Stream::Salsa20->new($key, $iv, $counter, $rounds);
 # $key     .. 32 or 16 bytes
 # $iv      .. 8 bytes
 # $counter .. initial counter value (DEFAULT: 0)
 # $rounds  .. rounds (DEFAULT: 20)

crypt

 $ciphertext = $stream->crypt($plaintext);
 #or
 $plaintext = $stream->crypt($ciphertext);

keystream

 $random_key = $stream->keystream($length);

clone

 $stream->clone();


SEE ALSO

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026