1DES(3) User Contributed Perl Documentation DES(3)
2
3
4
6 Crypt::DES - Perl DES encryption module
7
9 use Crypt::DES;
10
12 The module implements the Crypt::CBC interface, which has the following
13 methods
14
15 blocksize =item keysize =item encrypt =item decrypt
16
18 blocksize
19 Returns the size (in bytes) of the block cipher.
20
21 keysize
22 Returns the size (in bytes) of the key. Optimal size is 8 bytes.
23
24 new
25 my $cipher = new Crypt::DES $key;
26
27 This creates a new Crypt::DES BlockCipher object, using $key, where
28 $key is a key of "keysize()" bytes.
29
30 encrypt
31 my $cipher = new Crypt::DES $key;
32 my $ciphertext = $cipher->encrypt($plaintext);
33
34 This function encrypts $plaintext and returns the $ciphertext where
35 $plaintext and $ciphertext should be of "blocksize()" bytes.
36
37 decrypt
38 my $cipher = new Crypt::DES $key;
39 my $plaintext = $cipher->decrypt($ciphertext);
40
41 This function decrypts $ciphertext and returns the $plaintext where
42 $plaintext and $ciphertext should be of "blocksize()" bytes.
43
45 my $key = pack("H16", "0123456789ABCDEF");
46 my $cipher = new Crypt::DES $key;
47 my $ciphertext = $cipher->encrypt("plaintex"); # NB - 8 bytes
48 print unpack("H16", $ciphertext), "\n";
49
51 Do note that DES only uses 8 byte keys and only works on 8 byte data
52 blocks. If you're intending to encrypt larger blocks or entire files,
53 please use Crypt::CBC in conjunction with this module. See the
54 Crypt::CBC documentation for proper syntax and use.
55
56 Also note that the DES algorithm is, by today's standard, weak
57 encryption. Crypt::Blowfish is highly recommended if you're interested
58 in using strong encryption and a faster algorithm.
59
61 Crypt::Blowfish Crypt::IDEA
62
63 Bruce Schneier, Applied Cryptography, 1995, Second Edition, published
64 by John Wiley & Sons, Inc.
65
67 The implementation of the DES algorithm was developed by, and is
68 copyright of, Eric Young (eay@mincom.oz.au). Other parts of the perl
69 extension and module are copyright of Systemics Ltd (
70 http://www.systemics.com/ ). Cross-platform work and packaging for
71 single algorithm distribution is copyright of W3Works, LLC.
72
74 This single-algorithm package and cross-platform code is maintained by
75 Dave Paris <amused@pobox.com>.
76
77
78
79perl v5.16.3 2005-12-08 DES(3)