Filter-Crypto
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
=item B<-c E<lt>fileE<gt>>, B<--cipher-config=E<lt>fileE<gt>>
Specify the cipher configuration file with which to build. This should be a
file written by a previous run of B<Makefile.PL> containing the answers to all
the cipher configuration questions, which therefore will not be asked this time.
Any cipher configuration options specified along with this option will be
ignored.
This is useful if you ever need to rebuild this distribution using the same
configuration as was used on a previous occasion, for example, if you are
setting up two separate Perl installations, one containing the
Filter::Crypto::CryptFile module and another containing only the
Filter::Crypto::Decrypt module, as described under the B<--build> option above.
=item B<-n E<lt>nameE<gt>>, B<--cipher-name=E<lt>nameE<gt>>
Specify the name of the cipher algorithm to use. The ciphers available will be
a subset of the following (depending on which version of OpenSSL or SSLeay you
are using and whether any of them were disabled when it was built):
DES (A block cipher with fixed key length)
DES_EDE (A block cipher with fixed key length)
DES_EDE3 (A block cipher with fixed key length)
RC4 (A stream cipher with variable key length)
IDEA (A block cipher with fixed key length)
RC2 (A block cipher with variable key length)
DESX (A block cipher with fixed key length)
Blowfish (A block cipher with variable key length)
Null (The null cipher with zero key length)
RC5 (A block cipher with variable key length)
CAST5 (A block cipher with variable key length)
AES (A block cipher with variable key length)
The default cipher is AES if it is available, or else DES_EDE3 if that is
available, or else whichever one nearest the end of the list above is available.
=item B<-m E<lt>modeE<gt>>, B<--cipher-mode=E<lt>modeE<gt>>
Specify the mode of operation if a block cipher was chosen above. The following
modes are available:
ECB (Electronic Codebook Mode)
CBC (Cipher Block Chaining Mode)
CFB (64-Bit Cipher Feedback Mode)
OFB (64-Bit Output Feedback Mode)
The CBC mode is used by default.
This option is ignored for the DESX block cipher (which is only available in CBC
mode) and for the stream cipher(s) and the null cipher.
=item B<-p {E<lt>pswdE<gt>|rand}>, B<--pswd={E<lt>pswdE<gt>|rand}>
Specify the password from which to derive the key used for the encryption or
decryption. (This is known as "password-based encryption" (PBE).) The special
value "rand" means that a 32-byte password will be randomly generated using the
random number generator specified by the B<--rng> option.
The key will be derived using the PBKDF2 algorithm defined in PKCS#5 v2.0 (which
is also available as RFC2898). An 8-byte random salt and 2048 iterations are
used. A random initialization vector (IV) is also generated if required. When
encrypting, both the salt and IV are prepended to the ciphertext so that they
may be recovered for use when decrypting.
Alternatively, the key may be specified directly (or randomly generated) using
the B<--key> option below. If both options are given then B<--pswd> is used and
B<--key> is silently ignored.
Note that password-based encryption is preferable to using a fixed key if you
are going to be encrypting many files because the key used in the PBE scheme
will be different for each file that you encrypt because it is derived afresh
for each file using a new random salt. (This, of course, is exactly the point
of the salt.) Using the same key repeatedly is vulnerable to "dictionary
attacks", particularly if part of the files being encrypted is known or
predictable, for example, a header section like that used at the top of the
source files in this distribution.
A randomly generated password is used by default.
=item B<-k {E<lt>keyE<gt>|rand}>, B<--key={E<lt>keyE<gt>|rand}>
Specify the key if anything other than the null cipher was chosen above. The
special value "rand" means that a key of the appropriate length will be randomly
generated using the random number generator specified by the B<--rng> option.
If a key length is also specified using the B<--key-len> option below, or if you
have chosen a fixed key length cipher, then the length of any key specified here
must match the relevant key length.
An N-byte key must be specified as a string of 2*N hexadecimal digits where each
pair of such digits represents one byte of the key (with the high nybble first).
This is the format produced by Perl's built-in C<unpack()> function with the 'H'
template character, i.e.
$hexdigits = unpack 'H*', $bytes;
The key specified (or randomly generated) by this option is used directly
without being processed by any key derivation algorithm. For password-based
encryption, use the B<--pswd> option above. If both options are given then
B<--pswd> is used and B<--key> is silently ignored.
Note that password-based encryption is preferable to using a fixed key if you
are going to be encrypting many files. See the description of the B<--pswd>
option above for an explanation.
A randomly generated password [sic] is used by default.
=item B<-r E<lt>rngE<gt>>, B<--rng=E<lt>rngE<gt>>
Specify the random number generator (RNG) with which to generate the password or
key if the option to have one of them randomly generated was chosen above.
Valid RNGs are:
Perl - Use Perl's built-in rand() function
Crypt::Random - Use the Crypt::Random Perl module
Math::Random - Use the Math::Random Perl module
OpenSSL - Use OpenSSL's "rand" command
Note that not all of these options may be available: Crypt::Random and
Math::Random are not standard Perl modules.
( run in 1.135 second using v1.01-cache-2.11-cpan-71847e10f99 )