Movatterモバイル変換


[0]ホーム

URL:


 / 
Crypt-DES-2.07
River stage two • 18 direct dependents • 75 total dependents
/Crypt::DES

NAME

Crypt::DES - Perl DES encryption module

SYNOPSIS

use Crypt::DES;

DESCRIPTION

The module implements the Crypt::CBC interface, which has the following methods

blocksize =item keysize =item encrypt =item decrypt

FUNCTIONS

blocksize

Returns the size (in bytes) of the block cipher.

keysize

Returns the size (in bytes) of the key. Optimal size is 8 bytes.

new
my $cipher = new Crypt::DES $key;

This creates a new Crypt::DES BlockCipher object, using $key, where $key is a key ofkeysize() bytes.

encrypt
my $cipher = new Crypt::DES $key;my $ciphertext = $cipher->encrypt($plaintext);

This function encrypts $plaintext and returns the $ciphertext where $plaintext and $ciphertext should be ofblocksize() bytes.

decrypt
my $cipher = new Crypt::DES $key;my $plaintext = $cipher->decrypt($ciphertext);

This function decrypts $ciphertext and returns the $plaintext where $plaintext and $ciphertext should be ofblocksize() bytes.

EXAMPLE

my $key = pack("H16", "0123456789ABCDEF");my $cipher = new Crypt::DES $key;my $ciphertext = $cipher->encrypt("plaintex");# NB - 8 bytesprint unpack("H16", $ciphertext), "\n";

NOTES

Do note that DES only uses 8 byte keys and only works on 8 byte data blocks. If you're intending to encrypt larger blocks or entire files, please use Crypt::CBC in conjunction with this module. See the Crypt::CBC documentation for proper syntax and use.

Also note that the DES algorithm is, by today's standard, weak encryption. Crypt::Blowfish is highly recommended if you're interested in using strong encryption and a faster algorithm.

SEE ALSO

Crypt::Blowfish Crypt::IDEA

Bruce Schneier,Applied Cryptography, 1995, Second Edition, published by John Wiley & Sons, Inc.

COPYRIGHT

The implementation of the DES algorithm was developed by, and is copyright of, Eric Young (eay@mincom.oz.au). Other parts of the perl extension and module are copyright of Systemics Ltd ( http://www.systemics.com/ ). Cross-platform work and packaging for single algorithm distribution is copyright of W3Works, LLC.

MAINTAINER

This single-algorithm package and cross-platform code is maintained by Dave Paris <amused@pobox.com>.

Module Install Instructions

To install Crypt::DES, copy and paste the appropriate command in to your terminal.

cpanm

cpanm Crypt::DES

CPAN shell

perl -MCPAN -e shellinstall Crypt::DES

For more information on module installation, please visitthe detailed CPAN module installation guide.

Keyboard Shortcuts

Global
sFocus search bar
?Bring up this help dialog
GitHub
gpGo to pull requests
gigo to github issues (only if github is preferred repository)
POD
gaGo to author
gcGo to changes
giGo to issues
gdGo to dist
grGo to repository/SCM
gsGo to source
gbGo to file browse
Search terms
module: (e.g.module:Plugin)
distribution: (e.g.distribution:Dancer auth)
author: (e.g.author:SONGMU Redis)
version: (e.g.version:1.00)

[8]ページ先頭

©2009-2025 Movatter.jp