1Crypt::Cipher::DES_EDE(U3s)er Contributed Perl DocumentatCiroynpt::Cipher::DES_EDE(3)
2
3
4

NAME

6       Crypt::Cipher::DES_EDE - Symmetric cipher DES_EDE (aka Triple-DES,
7       3DES), key size: 192[168] bits
8

SYNOPSIS

10         ### example 1
11         use Crypt::Mode::CBC;
12
13         my $key = '...'; # length has to be valid key size for this cipher
14         my $iv = '...';  # 16 bytes
15         my $cbc = Crypt::Mode::CBC->new('DES_EDE');
16         my $ciphertext = $cbc->encrypt("secret data", $key, $iv);
17
18         ### example 2 (slower)
19         use Crypt::CBC;
20         use Crypt::Cipher::DES_EDE;
21
22         my $key = '...'; # length has to be valid key size for this cipher
23         my $iv = '...';  # 16 bytes
24         my $cbc = Crypt::CBC->new( -cipher=>'Cipher::DES_EDE', -key=>$key, -iv=>$iv );
25         my $ciphertext = $cbc->encrypt("secret data");
26

DESCRIPTION

28       This module implements the DES_EDE cipher. Provided interface is
29       compliant with Crypt::CBC module.
30
31       BEWARE: This module implements just elementary
32       "one-block-(en|de)cryption" operation - if you want to encrypt/decrypt
33       generic data you have to use some of the cipher block modes - check for
34       example Crypt::Mode::CBC, Crypt::Mode::CTR or Crypt::CBC (which will be
35       slower).
36

METHODS

38   new
39        $c = Crypt::Cipher::DES_EDE->new($key);
40        #or
41        $c = Crypt::Cipher::DES_EDE->new($key, $rounds);
42
43   encrypt
44        $ciphertext = $c->encrypt($plaintext);
45
46   decrypt
47        $plaintext = $c->decrypt($ciphertext);
48
49   keysize
50         $c->keysize;
51         #or
52         Crypt::Cipher::DES_EDE->keysize;
53         #or
54         Crypt::Cipher::DES_EDE::keysize;
55
56   blocksize
57         $c->blocksize;
58         #or
59         Crypt::Cipher::DES_EDE->blocksize;
60         #or
61         Crypt::Cipher::DES_EDE::blocksize;
62
63   max_keysize
64         $c->max_keysize;
65         #or
66         Crypt::Cipher::DES_EDE->max_keysize;
67         #or
68         Crypt::Cipher::DES_EDE::max_keysize;
69
70   min_keysize
71         $c->min_keysize;
72         #or
73         Crypt::Cipher::DES_EDE->min_keysize;
74         #or
75         Crypt::Cipher::DES_EDE::min_keysize;
76
77   default_rounds
78         $c->default_rounds;
79         #or
80         Crypt::Cipher::DES_EDE->default_rounds;
81         #or
82         Crypt::Cipher::DES_EDE::default_rounds;
83

SEE ALSO

85       •   CryptX, Crypt::Cipher
86
87       •   <https://en.wikipedia.org/wiki/Triple_DES>
88
89
90
91perl v5.36.0                      2022-07-22         Crypt::Cipher::DES_EDE(3)
Impressum