view release on metacpan or search on metacpan
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
my $public = curve25519_public_key($private);
my $shared = curve25519_shared_secret($private, $public_key);
my ($encrypt_key, $sign_key) = unpack 'a16 a16', sha256($shared);
my $iv = substr sha256($public), 0, 16;
my $cipher = Crypt::Rijndael->new($encrypt_key, Crypt::Rijndael::MODE_CBC);
my $pad_length = 16 - length($data) % 16;
my $padding = chr($pad_length) x $pad_length;
my $ciphertext = $cipher->encrypt($data . $padding, $iv);
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
my $shared = curve25519_shared_secret($private_key, $public);
my ($encrypt_key, $sign_key) = unpack 'a16 a16', sha256($shared);
my $iv = substr sha256($public), 0, 16;
croak 'MAC is incorrect' if hmac_sha256($iv . $ciphertext, $sign_key) ne $mac;
my $cipher = Crypt::Rijndael->new($encrypt_key, Crypt::Rijndael::MODE_CBC);
my $plaintext = $cipher->decrypt($ciphertext, $iv);
my $pad_length = ord substr $plaintext, -1;
substr($plaintext, -$pad_length, $pad_length, '') eq chr($pad_length) x $pad_length or croak 'Incorrectly padded';
return $plaintext;
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
my $private_ephemeral = curve25519_secret_key(random_bytes(32));
my $ephemeral_public = curve25519_public_key($private_ephemeral);
my $primary_shared = curve25519_shared_secret($private_ephemeral, $public_key_other);
my ($primary_encrypt_key, $primary_iv) = unpack 'a16 a16', sha256($primary_shared);
my $primary_cipher = Crypt::Rijndael->new($primary_encrypt_key, Crypt::Rijndael::MODE_CBC);
my $encrypted_public_key = $primary_cipher->encrypt($public_key_self, $primary_iv);
my $secondary_shared = $primary_shared . curve25519_shared_secret($private_key_self, $public_key_other);
my ($secondary_encrypt_key, $sign_key) = unpack 'a16 a16', sha256($secondary_shared);
my $cipher = Crypt::Rijndael->new($secondary_encrypt_key, Crypt::Rijndael::MODE_CBC);
my $iv = substr sha256($ephemeral_public), 0, 16;
my $pad_length = 16 - length($data) % 16;
my $padding = chr($pad_length) x $pad_length;
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
my ($options, $ephemeral_public, $encrypted_public_key, $mac, $ciphertext) = unpack $format_authenticated, $packed_data;
croak 'Unknown options' if $options ne "\x{1}";
my $primary_shared = curve25519_shared_secret($private_key, $ephemeral_public);
my ($primary_encrypt_key, $primary_iv) = unpack 'a16 a16', sha256($primary_shared);
my $primary_cipher = Crypt::Rijndael->new($primary_encrypt_key, Crypt::Rijndael::MODE_CBC);
my $public_key = $primary_cipher->decrypt($encrypted_public_key, $primary_iv);
my $secondary_shared = $primary_shared . curve25519_shared_secret($private_key, $public_key);
my ($secondary_encrypt_key, $sign_key) = unpack 'a16 a16', sha256($secondary_shared);
my $cipher = Crypt::Rijndael->new($secondary_encrypt_key, Crypt::Rijndael::MODE_CBC);
my $iv = substr sha256($ephemeral_public), 0, 16;
croak 'MAC is incorrect' if hmac_sha256($iv . $ciphertext, $sign_key) ne $mac;
my $plaintext = $cipher->decrypt($ciphertext, $iv);
lib/Crypt/ECDH_ES.pm view on Meta::CPAN
You may want to use this module when storing sensive data in such a way that the encoding side can't read it afterwards, for example a website storing credit card data in a database that will be used by a separate back-end financial processor. When u...
=head2 Technical details
This modules uses Daniel J. Bernstein's curve25519 (also used by OpenSSH) to perform a Diffie-Hellman key agreement between an encoder and a decoder. The keys of the decoder should be known in advance (as this system works as a one-way communication ...
All cryptographic components are believed to provide at least 128-bits of security.
=head2 Variants
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/EECDH.pm view on Meta::CPAN
my $public = curve25519_public_key($private);
my $shared = curve25519_shared_secret($private, $arg{PublicKey});
my ($encrypt_key, $sign_key) = unpack 'a16 a16', sha256($shared);
my $iv = substr sha256($public), 0, 16;
my $cipher = Crypt::Rijndael->new($encrypt_key, Crypt::Rijndael::MODE_CBC);
$cipher->set_iv($iv);
my $pad_length = 16 - length($arg{Message}) % 16;
my $padding = chr($pad_length) x $pad_length;
lib/Crypt/EECDH.pm view on Meta::CPAN
my $shared = curve25519_shared_secret($arg{Key}, $public);
my ($encrypt_key, $sign_key) = unpack 'a16 a16', sha256($shared);
my $iv = substr sha256($public), 0, 16;
die 'MAC is incorrect' if hmac_sha256($iv . $ciphertext, $sign_key) ne $mac;
my $cipher = Crypt::Rijndael->new($encrypt_key, Crypt::Rijndael::MODE_CBC);
$cipher->set_iv($iv);
my $plaintext = $cipher->decrypt($ciphertext);
my $pad_length = ord substr $plaintext, -1;
substr($plaintext, -$pad_length, $pad_length, '') eq chr($pad_length) x $pad_length or die 'Incorrectly padded';
lib/Crypt/EECDH.pm view on Meta::CPAN
=head1 TECHNICAL DETAILS
This modules uses Daniel J. Bernstein's curve25519 to perform a
Diffie-Hellman key agreement. A new keypair is generated for every
encryption operation. The shared key resulting from the key agreement
is hashed and used to encrypt the plaintext using AES in CBC mode
(with the IV deterministically derived from the public key). It also
adds a HMAC, with the key derived from the same shared secret as the
encryption key.
Some of the code in this module (and most of the text of the previous
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Eksblowfish.pm view on Meta::CPAN
keying: the number of operations in key setup is proportional to 2^COST.
All three parameters influence all the subkeys; changing any of them
produces a different encryption function.
Due to the mandatory family-keying parameters (COST and SALT), this
constructor does not match the interface expected by C<Crypt::CBC>
and similar crypto plumbing modules. To
use Eksblowfish with them it is necessary to have an object that
encapsulates a cipher family and provides a constructor that takes only a
key argument. That facility is supplied by C<Crypt::Eksblowfish::Family>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Fernet.pm view on Meta::CPAN
sub fernet_encrypt { Crypt::Fernet::encrypt(@_) }
sub fernet_verify { Crypt::Fernet::verify(@_) }
sub fernet_decrypt { Crypt::Fernet::decrypt(@_) }
use Crypt::CBC;
use Crypt::Rijndael;
use Crypt::URandom qw( urandom );
use Digest::SHA qw(hmac_sha256);
use MIME::Base64::URLSafe;
lib/Crypt/Fernet.pm view on Meta::CPAN
my ($key, $data) = @_;
my $b64decode_key = urlsafe_b64decode($key);
my $signkey = substr $b64decode_key, 0, 16;
my $encryptkey = substr $b64decode_key, 16, 16;
my $iv = urandom(16);
my $cipher = Crypt::CBC->new(-literal_key => 1,
-key => $encryptkey,
-iv => $iv,
-keysize => 16,
-padding => 'standard',
-cipher => 'Rijndael',
lib/Crypt/Fernet.pm view on Meta::CPAN
my $iv = substr $token_data, 9, 16;
my $ciphertextlen = (length $token_data) - 25 - 32;
my $ciphertext = substr $token_data, 25, $ciphertextlen;
my $cipher = Crypt::CBC->new(-literal_key => 1,
-key => $encryptkey,
-iv => $iv,
-keysize => 16,
-padding => 'standard',
-cipher => 'Rijndael',
lib/Crypt/Fernet.pm view on Meta::CPAN
=head1 DEPENDENCIES
This module requires these other modules and libraries:
use Crypt::CBC;
use Digest::SHA qw(hmac_sha256);
use MIME::Base64::URLSafe;
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/FileHandle.pm view on Meta::CPAN
Crypt::FileHandle - encrypted FileHandle
=head1 SYNOPSIS
use Crypt::CBC;
use Crypt::FileHandle;
# example cipher
$cipher = Crypt::CBC->new(
-cipher => 'Cipher::AES',
-key => $key,
-header => 'salt'
);
lib/Crypt/FileHandle.pm view on Meta::CPAN
new() can be treated like a normal FileHandle. All encrypting,
decrypting, and buffering is completely transparent to the caller.
=head1 CIPHER METHODS
This package generally supports ciphers compliant with Crypt::CBC,
including CryptX ciphers. The cipher provided to new() must support
at least the methods listed below, but no other methods are utilized
by this package. Refer to Crypt::CBC for more information on these
methods. Even though it is not recommended, a custom home-made cipher
object can be used if it supports these methods.
=over 4
lib/Crypt/FileHandle.pm view on Meta::CPAN
The syswrite() and sysread() methods are always used to write to and
read from real handles. This package cannot be used with handles that
do not support these methods, such as opening directly to a Perl
scalar.
If the salt or randomiv header options are not used in the Crypt::CBC
cipher provided to new(), it is the caller's responsibility to
initialize the decryption cipher appropriately to include any
necessary salt or iv values. Otherwise using the same cipher to both
encrypt and decrypt will be unsuccessful since the salt or iv values
are not included in the encrypted file. When the salt header option
lib/Crypt/FileHandle.pm view on Meta::CPAN
openssl enc -d -aes-256-cbc -in <file> -k <key>
=back
Due to cipher block chaining (CBC), random access is currently not
permitted with this package. It would likely be necessary to read or
write the entire contents of the file, or large portions of it, to
enable random access. For this reason, the following restrictions
exist.
lib/Crypt/FileHandle.pm view on Meta::CPAN
FileHandle and the Crypt::FileHandle object since there will no
longer be any references to either.
=head1 SEE ALSO
FileHandle(3), Crypt::CBC(3), CryptX(3), OpenSSL(1)
=head1 AUTHOR
Christopher J. Dunkle
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/GCrypt.pm view on Meta::CPAN
=over 8
=item B<standard>
This is also known as PKCS#5 padding, as it's binary safe. The string is padded
with the number of bytes that should be truncated. It's compatible with Crypt::CBC.
=item B<null>
Only for text strings. The block will be padded with null bytes (00). If the last
block is a full block and blocksize is 8, a block of "0000000000000000" will be
lib/Crypt/GCrypt.pm view on Meta::CPAN
$ciphertext .= $cipher->finish;
$plaintext .= $cipher->finish;
The CBC algorithm must buffer data blocks internally until there are even
multiples of the encryption algorithm's blocksize (typically 8 or 16 bytes).
After the last call to encrypt() or decrypt() you should call finish() to flush
the internal buffer and return any leftover data. This method will also take care
of padding/unpadding of data (see the L</padding> option above).
view all matches for this distribution
view release on metacpan or search on metacpan
GOST 28147-89 is a 64-bit symmetric block cipher with a 256-bit key
developed in the former Soviet Union. Some information on it is
available at <URL:http://vipul.net/gost/>.
This module implements GOST encryption. It supports the Crypt::CBC
interface, with the functions described below. It also provides an
interface that is backwards-compatible with Crypt::GOST 0.41, but its
use in new code is discouraged.
=head2 Functions
=back
=head1 SEE ALSO
Crypt::CBC, Crypt::Twofish, Crypt::TEA
=head1 ACKNOWLEDGEMENTS
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
include/pkcs11t.h view on Meta::CPAN
#define CKM_SHA3_224_RSA_PKCS 0x00000066UL
#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL
#define CKM_RC2_KEY_GEN 0x00000100UL /* Historical */
#define CKM_RC2_ECB 0x00000101UL /* Historical */
#define CKM_RC2_CBC 0x00000102UL /* Historical */
#define CKM_RC2_MAC 0x00000103UL /* Historical */
#define CKM_RC2_MAC_GENERAL 0x00000104UL /* Historical */
#define CKM_RC2_CBC_PAD 0x00000105UL /* Historical */
#define CKM_RC4_KEY_GEN 0x00000110UL /* Historical */
#define CKM_RC4 0x00000111UL /* Historical */
#define CKM_DES_KEY_GEN 0x00000120UL /* Historical */
#define CKM_DES_ECB 0x00000121UL /* Historical */
#define CKM_DES_CBC 0x00000122UL /* Historical */
#define CKM_DES_MAC 0x00000123UL /* Historical */
#define CKM_DES_MAC_GENERAL 0x00000124UL /* Historical */
#define CKM_DES_CBC_PAD 0x00000125UL /* Historical */
#define CKM_DES2_KEY_GEN 0x00000130UL
#define CKM_DES3_KEY_GEN 0x00000131UL
#define CKM_DES3_ECB 0x00000132UL
#define CKM_DES3_CBC 0x00000133UL
#define CKM_DES3_MAC 0x00000134UL
#define CKM_DES3_MAC_GENERAL 0x00000135UL
#define CKM_DES3_CBC_PAD 0x00000136UL
#define CKM_DES3_CMAC_GENERAL 0x00000137UL
#define CKM_DES3_CMAC 0x00000138UL
#define CKM_CDMF_KEY_GEN 0x00000140UL /* Historical */
#define CKM_CDMF_ECB 0x00000141UL /* Historical */
#define CKM_CDMF_CBC 0x00000142UL /* Historical */
#define CKM_CDMF_MAC 0x00000143UL /* Historical */
#define CKM_CDMF_MAC_GENERAL 0x00000144UL /* Historical */
#define CKM_CDMF_CBC_PAD 0x00000145UL /* Historical */
#define CKM_DES_OFB64 0x00000150UL
#define CKM_DES_OFB8 0x00000151UL
#define CKM_DES_CFB64 0x00000152UL
#define CKM_DES_CFB8 0x00000153UL
include/pkcs11t.h view on Meta::CPAN
#define CKM_SHA3_512_KEY_GEN 0x000002d3UL
#define CKM_CAST_KEY_GEN 0x00000300UL /* Historical */
#define CKM_CAST_ECB 0x00000301UL /* Historical */
#define CKM_CAST_CBC 0x00000302UL /* Historical */
#define CKM_CAST_MAC 0x00000303UL /* Historical */
#define CKM_CAST_MAC_GENERAL 0x00000304UL /* Historical */
#define CKM_CAST_CBC_PAD 0x00000305UL /* Historical */
#define CKM_CAST3_KEY_GEN 0x00000310UL /* Historical */
#define CKM_CAST3_ECB 0x00000311UL /* Historical */
#define CKM_CAST3_CBC 0x00000312UL /* Historical */
#define CKM_CAST3_MAC 0x00000313UL /* Historical */
#define CKM_CAST3_MAC_GENERAL 0x00000314UL /* Historical */
#define CKM_CAST3_CBC_PAD 0x00000315UL /* Historical */
/* Note that CAST128 and CAST5 are the same algorithm */
#define CKM_CAST5_KEY_GEN 0x00000320UL /* Historical */
#define CKM_CAST128_KEY_GEN 0x00000320UL /* Historical */
#define CKM_CAST5_ECB 0x00000321UL /* Historical */
#define CKM_CAST128_ECB 0x00000321UL /* Historical */
#define CKM_CAST5_CBC 0x00000322UL /* Deprecated */
#define CKM_CAST128_CBC 0x00000322UL /* Historical */
#define CKM_CAST5_MAC 0x00000323UL /* Deprecated */
#define CKM_CAST128_MAC 0x00000323UL /* Historical */
#define CKM_CAST5_MAC_GENERAL 0x00000324UL /* Deprecated */
#define CKM_CAST128_MAC_GENERAL 0x00000324UL /* Historical */
#define CKM_CAST5_CBC_PAD 0x00000325UL /* Deprecated */
#define CKM_CAST128_CBC_PAD 0x00000325UL /* Historical */
#define CKM_RC5_KEY_GEN 0x00000330UL /* Historical */
#define CKM_RC5_ECB 0x00000331UL /* Historical */
#define CKM_RC5_CBC 0x00000332UL /* Historical */
#define CKM_RC5_MAC 0x00000333UL /* Historical */
#define CKM_RC5_MAC_GENERAL 0x00000334UL /* Historical */
#define CKM_RC5_CBC_PAD 0x00000335UL /* Historical */
#define CKM_IDEA_KEY_GEN 0x00000340UL /* Historical */
#define CKM_IDEA_ECB 0x00000341UL /* Historical */
#define CKM_IDEA_CBC 0x00000342UL /* Historical */
#define CKM_IDEA_MAC 0x00000343UL /* Historical */
#define CKM_IDEA_MAC_GENERAL 0x00000344UL /* Historical */
#define CKM_IDEA_CBC_PAD 0x00000345UL /* Historical */
#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL
#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL
#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL
#define CKM_XOR_BASE_AND_DATA 0x00000364UL
include/pkcs11t.h view on Meta::CPAN
#define CKM_SHA3_384_KEY_DERIVE CKM_SHA3_384_KEY_DERIVATION
#define CKM_SHA3_512_KEY_DERIVE CKM_SHA3_512_KEY_DERIVATION
#define CKM_SHAKE_128_KEY_DERIVE CKM_SHAKE_128_KEY_DERIVATION
#define CKM_SHAKE_256_KEY_DERIVE CKM_SHAKE_256_KEY_DERIVATION
#define CKM_PBE_MD2_DES_CBC 0x000003a0UL /* Historical */
#define CKM_PBE_MD5_DES_CBC 0x000003a1UL /* Historical */
#define CKM_PBE_MD5_CAST_CBC 0x000003a2UL /* Historical */
#define CKM_PBE_MD5_CAST3_CBC 0x000003a3UL /* Historical */
#define CKM_PBE_MD5_CAST5_CBC 0x000003a4UL /* Deprecated */
#define CKM_PBE_MD5_CAST128_CBC 0x000003a4UL /* Historical */
#define CKM_PBE_SHA1_CAST5_CBC 0x000003a5UL /* Deprecated */
#define CKM_PBE_SHA1_CAST128_CBC 0x000003a5UL /* Historical */
#define CKM_PBE_SHA1_RC4_128 0x000003a6UL /* Historical */
#define CKM_PBE_SHA1_RC4_40 0x000003a7UL /* Historical */
#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003a8UL
#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003a9UL
#define CKM_PBE_SHA1_RC2_128_CBC 0x000003aaUL
#define CKM_PBE_SHA1_RC2_40_CBC 0x000003abUL
#define CKM_PKCS5_PBKD2 0x000003b0UL
#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003c0UL
include/pkcs11t.h view on Meta::CPAN
#define CKM_KIP_WRAP 0x00000511UL
#define CKM_KIP_MAC 0x00000512UL
#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
#define CKM_CAMELLIA_ECB 0x00000551UL
#define CKM_CAMELLIA_CBC 0x00000552UL
#define CKM_CAMELLIA_MAC 0x00000553UL
#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL
#define CKM_CAMELLIA_CBC_PAD 0x00000555UL
#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL
#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL
#define CKM_CAMELLIA_CTR 0x00000558UL /* Historical */
#define CKM_ARIA_KEY_GEN 0x00000560UL
#define CKM_ARIA_ECB 0x00000561UL
#define CKM_ARIA_CBC 0x00000562UL
#define CKM_ARIA_MAC 0x00000563UL
#define CKM_ARIA_MAC_GENERAL 0x00000564UL
#define CKM_ARIA_CBC_PAD 0x00000565UL
#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566UL
#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567UL
#define CKM_SEED_KEY_GEN 0x00000650UL
#define CKM_SEED_ECB 0x00000651UL
#define CKM_SEED_CBC 0x00000652UL
#define CKM_SEED_MAC 0x00000653UL
#define CKM_SEED_MAC_GENERAL 0x00000654UL
#define CKM_SEED_CBC_PAD 0x00000655UL
#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL
#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL
#define CKM_SKIPJACK_KEY_GEN 0x00001000UL /* Historical */
#define CKM_SKIPJACK_ECB64 0x00001001UL /* Historical */
#define CKM_SKIPJACK_CBC64 0x00001002UL /* Historical */
#define CKM_SKIPJACK_OFB64 0x00001003UL /* Historical */
#define CKM_SKIPJACK_CFB64 0x00001004UL /* Historical */
#define CKM_SKIPJACK_CFB32 0x00001005UL /* Historical */
#define CKM_SKIPJACK_CFB16 0x00001006UL /* Historical */
#define CKM_SKIPJACK_CFB8 0x00001007UL /* Historical */
include/pkcs11t.h view on Meta::CPAN
#define CKM_KEA_DERIVE 0x00001012UL /* Historical */
#define CKM_FORTEZZA_TIMESTAMP 0x00001020UL /* Historical */
#define CKM_BATON_KEY_GEN 0x00001030UL /* Historical */
#define CKM_BATON_ECB128 0x00001031UL /* Historical */
#define CKM_BATON_ECB96 0x00001032UL /* Historical */
#define CKM_BATON_CBC128 0x00001033UL /* Historical */
#define CKM_BATON_COUNTER 0x00001034UL /* Historical */
#define CKM_BATON_SHUFFLE 0x00001035UL /* Historical */
#define CKM_BATON_WRAP 0x00001036UL /* Historical */
#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040UL /* Deprecated */
include/pkcs11t.h view on Meta::CPAN
#define CKM_ECDH_AES_KEY_WRAP 0x00001053UL
#define CKM_RSA_AES_KEY_WRAP 0x00001054UL
#define CKM_JUNIPER_KEY_GEN 0x00001060UL /* Historical */
#define CKM_JUNIPER_ECB128 0x00001061UL /* Historical */
#define CKM_JUNIPER_CBC128 0x00001062UL /* Historical */
#define CKM_JUNIPER_COUNTER 0x00001063UL /* Historical */
#define CKM_JUNIPER_SHUFFLE 0x00001064UL /* Historical */
#define CKM_JUNIPER_WRAP 0x00001065UL /* Historical */
#define CKM_FASTHASH 0x00001070UL
#define CKM_AES_XTS 0x00001071UL
#define CKM_AES_XTS_KEY_GEN 0x00001072UL
#define CKM_AES_KEY_GEN 0x00001080UL
#define CKM_AES_ECB 0x00001081UL
#define CKM_AES_CBC 0x00001082UL
#define CKM_AES_MAC 0x00001083UL
#define CKM_AES_MAC_GENERAL 0x00001084UL
#define CKM_AES_CBC_PAD 0x00001085UL
#define CKM_AES_CTR 0x00001086UL
#define CKM_AES_GCM 0x00001087UL
#define CKM_AES_CCM 0x00001088UL
#define CKM_AES_CTS 0x00001089UL
#define CKM_AES_CMAC 0x0000108aUL
#define CKM_AES_CMAC_GENERAL 0x0000108bUL
#define CKM_AES_XCBC_MAC 0x0000108cUL
#define CKM_AES_XCBC_MAC_96 0x0000108dUL
#define CKM_AES_GMAC 0x0000108eUL
#define CKM_BLOWFISH_KEY_GEN 0x00001090UL
#define CKM_BLOWFISH_CBC 0x00001091UL
#define CKM_TWOFISH_KEY_GEN 0x00001092UL
#define CKM_TWOFISH_CBC 0x00001093UL
#define CKM_BLOWFISH_CBC_PAD 0x00001094UL
#define CKM_TWOFISH_CBC_PAD 0x00001095UL
#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100UL
#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101UL
#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL
#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL
#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL
#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL
#define CKM_GOSTR3410_KEY_PAIR_GEN 0x00001200UL
#define CKM_GOSTR3410 0x00001201UL
#define CKM_GOSTR3410_WITH_GOSTR3411 0x00001202UL
#define CKM_GOSTR3410_KEY_WRAP 0x00001203UL
include/pkcs11t.h view on Meta::CPAN
typedef CK_ULONG CK_RC2_PARAMS;
typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR;
/* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC
* mechanism
*/
typedef struct CK_RC2_CBC_PARAMS {
CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */
CK_BYTE iv[8]; /* IV for CBC mode */
} CK_RC2_CBC_PARAMS;
typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR;
/* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the
* CKM_RC2_MAC_GENERAL mechanism
*/
include/pkcs11t.h view on Meta::CPAN
} CK_RC5_PARAMS;
typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR;
/* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC
* mechanism
*/
typedef struct CK_RC5_CBC_PARAMS {
CK_ULONG ulWordsize; /* wordsize in bits */
CK_ULONG ulRounds; /* number of rounds */
CK_BYTE_PTR pIv; /* pointer to IV */
CK_ULONG ulIvLen; /* length of IV in bytes */
} CK_RC5_CBC_PARAMS;
typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR;
/* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the
* CKM_RC5_MAC_GENERAL mechanism
*/
include/pkcs11t.h view on Meta::CPAN
*/
typedef CK_ULONG CK_MAC_GENERAL_PARAMS;
typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR;
typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[8];
CK_BYTE_PTR pData;
CK_ULONG length;
} CK_DES_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR;
typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[16];
CK_BYTE_PTR pData;
CK_ULONG length;
} CK_AES_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR;
/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the
* CKM_SKIPJACK_PRIVATE_WRAP mechanism
*/
typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS {
include/pkcs11t.h view on Meta::CPAN
CK_BYTE cb[16];
} CK_CAMELLIA_CTR_PARAMS;
typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR;
typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[16];
CK_BYTE_PTR pData;
CK_ULONG length;
} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[16];
CK_BYTE_PTR pData;
CK_ULONG length;
} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR;
typedef struct CK_DSA_PARAMETER_GEN_PARAM {
CK_MECHANISM_TYPE hash;
CK_BYTE_PTR pSeed;
CK_ULONG ulSeedLen;
include/pkcs11t.h view on Meta::CPAN
CK_OBJECT_HANDLE hKey;
} CK_GOSTR3410_KEY_WRAP_PARAMS;
typedef CK_GOSTR3410_KEY_WRAP_PARAMS CK_PTR CK_GOSTR3410_KEY_WRAP_PARAMS_PTR;
typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS {
CK_BYTE iv[16];
CK_BYTE_PTR pData;
CK_ULONG length;
} CK_SEED_CBC_ENCRYPT_DATA_PARAMS;
typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \
CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR;
/*
* New PKCS 11 v3.0 data structures.
*/
view all matches for this distribution
view release on metacpan or search on metacpan
bin/hashcash.pl view on Meta::CPAN
# $coinexp .= ' ' . $_->as_string;
$coinexp .= $_->as_hex;
}
$coinexp = pack('H*', $coinexp);
if ($passphrase) {
my $cipher = Crypt::CBC->new (-key => $passphrase, -cipher => 'Rijndael', -header => 'salt');
$coinexp = $cipher->encrypt($coinexp);
}
$coinexp = _squish($coinexp);
my ($msg, $qr, $st) = ('Copy coins from below');
my $len = length($coinexp);
bin/hashcash.pl view on Meta::CPAN
$dialog = Wx::TextEntryDialog->new( $frame, "Enter passphrase to decrypt coins", "Add coins to wallet");
if($dialog->ShowModal == wxID_CANCEL) {
return;
}
my $passphrase = $dialog->GetValue();
my $cipher = Crypt::CBC->new (-key => $passphrase, -cipher => 'Rijndael');
my $decrypted = $cipher->decrypt(pack 'H*', $coins); $decrypted =~ s/\s*$//;
return unless $decrypted =~ /^\[\#\](R|E)/;
$decrypted = unpack('H*',$decrypted);
$decrypted =~ /^5b235d(52|45)([0-9a-f]{32})(.*)$/; ($sigscheme, $vaultid, $coins) = ($1, _dec($2), $3);
my $coinsize = ($sigscheme == 52) ? 296 : 170;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-crypt-hill.t view on Meta::CPAN
use strict; use warnings;
use Test::More tests => 4;
use Crypt::Hill;
eval { Crypt::Hill->new({ key => 'BCBC' }); };
like($@, qr/ERROR: Invalid key/);
eval { Crypt::Hill->new({ key => 'BCBCB' }); };
like($@, qr/ERROR: Key should be of length 4/);
eval { Crypt::Hill->new({ key => 'BCB' }); };
like($@, qr/ERROR: Key should be of length 4/);
view all matches for this distribution
view release on metacpan or search on metacpan
This is Crypt::IDEA version 1.06, an XS-based implementation of the
patent-encumbered IDEA cryptography algorithm. It's designed
to take full advantage of Crypt::CBC when desired. This module builds
on many plaforms, with a little assistance (although this should be
more rare now).
Prerequisites
-------------
For the full test suite to run, Crypt::CBC, version 1.22 or higher
is required (recommended is 1.25 or higher), however this module
is not mandatory for standalone IDEA use.
Installing Crypt::IDEA
--------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/JWT.pm view on Meta::CPAN
my $cek;
my $ecek;
if ($enc =~ /^A(128|192|256)GCM/) {
$cek = random_bytes($1/8);
}
elsif ($enc =~ /^A(128|192|256)CBC/) {
$cek = random_bytes(2*$1/8);
}
if ($alg =~ /^A(128|192|256)KW$/) {
$ecek = aes_key_wrap(_prepare_oct_key($key), $cek);
lib/Crypt/JWT.pm view on Meta::CPAN
croak "JWE: wrong AES key length ($len1 vs. $len2) for $enc" unless $len1 == $len2;
my $iv = random_bytes(12); # for AESGCM always 12 (96 bits)
my ($ct, $tag) = gcm_encrypt_authenticate('AES', $cek, $iv, $aad, $payload);
return ($ct, $iv, $tag);
}
elsif ($enc =~ /^A(128|192|256)CBC-HS(256|384|512)$/) {
# https://tools.ietf.org/html/rfc7518#section-5.2
my ($size, $hash) = ($1/8, "SHA$2");
my $key_len = length($cek) / 2;
my $mac_key = substr($cek, 0, $key_len);
my $aes_key = substr($cek, $key_len, $key_len);
croak "JWE: wrong AES key length ($key_len vs. $size)" unless $key_len == $size;
my $iv = random_bytes(16); # for AES always 16
my $m = Crypt::Mode::CBC->new('AES');
my $ct = $m->encrypt($payload, $aes_key, $iv);
my $aad_len = length($aad);
my $mac_input = $aad . $iv . $ct . pack('N2', ($aad_len / 2147483647)*8, ($aad_len % 2147483647)*8);
my $mac = hmac($hash, $mac_key, $mac_input);
my $sig_len = length($mac) / 2;
lib/Crypt/JWT.pm view on Meta::CPAN
my $len1 = $1/8;
my $len2 = length($cek);
croak "JWE: wrong AES key length ($len1 vs. $len2) for $enc" unless $len1 == $len2;
return gcm_decrypt_verify('AES', $cek, $iv, $aad, $ct, $tag);
}
elsif ($enc =~ /^A(128|192|256)CBC-HS(256|384|512)$/) {
# https://tools.ietf.org/html/rfc7518#section-5.2
my ($size, $hash) = ($1/8, "SHA$2");
my $key_len = length($cek) / 2;
my $mac_key = substr($cek, 0, $key_len);
my $aes_key = substr($cek, $key_len, $key_len);
lib/Crypt/JWT.pm view on Meta::CPAN
my $mac_input = $aad . $iv . $ct . pack('N2', ($aad_len / 2147483647)*8, ($aad_len % 2147483647)*8);
my $mac = hmac($hash, $mac_key, $mac_input);
my $sig_len = length($mac) / 2;
my $sig = substr($mac, 0, $sig_len);
croak "JWE: tag mismatch" unless $sig eq $tag;
my $m = Crypt::Mode::CBC->new('AES');
my $pt = $m->decrypt($ct, $aes_key, $iv);
return $pt;
}
croak "JWE: unsupported enc '$enc'";
}
lib/Crypt/JWT.pm view on Meta::CPAN
Supported 'enc' algorithms:
A128GCM
A192GCM
A256GCM
A128CBC-HS256
A192CBC-HS384
A256CBC-HS512
=item key
A key used for token encryption (JWE) or token signing (JWS). The value depends on C<alg> token header value.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Keyczar/AesKey.pm view on Meta::CPAN
use warnings;
use Crypt::Keyczar qw(KEY_HASH_SIZE);
use Crypt::Keyczar::HmacKey;
use constant DEFAULT_MODE => 'CBC';
sub expose {
my $self = shift;
my $expose = {};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Keys/Private/RSA/SSH1.pm view on Meta::CPAN
BEGIN {
%CIPHERS = (
1 => undef, ## IDEA: requires CFB
2 => sub { ## DES
require Crypt::DES;
Crypt::CBC->new(
Cipher => Crypt::DES->new(substr $_[0], 0, 8),
IV => chr(0)x8,
);
},
3 => sub { ## 3DES
Crypt::Keys::Private::RSA::SSH1::DES3->new($_[0]);
},
);
}
use Crypt::CBC;
use Digest::MD5 qw( md5 );
use Crypt::Keys::Util qw( bitsize mod_inverse );
use Crypt::Keys::Buffer;
use Crypt::Keys::ErrorHandler;
lib/Crypt/Keys/Private/RSA/SSH1.pm view on Meta::CPAN
}
package Crypt::Keys::Private::RSA::SSH1::DES3;
use strict;
use Crypt::CBC;
use Crypt::DES;
sub new {
my $class = shift;
my $cipher = bless {}, $class;
lib/Crypt/Keys/Private/RSA/SSH1.pm view on Meta::CPAN
my($key) = @_;
for my $i (1..3) {
my $this_key = $i == 3 && length($key) <= 16 ?
substr $key, 0, 8 :
substr $key, 8*($i-1), 8;
$cipher->{"cbc$i"} = Crypt::CBC->new({
key => $this_key,
cipher => 'Crypt::DES',
regenerate_key => 0,
iv => chr(0)x8,
prepend_iv => 0,
view all matches for this distribution
view release on metacpan or search on metacpan
__END__
=head1 NAME
Crypt::Khazad - Crypt::CBC-compliant block cipher
=head1 ABSTRACT
Khazad is a 128-bit key, 64-bit block cipher, designed by Vincent
Rijmen and Paulo S. L. M. Barreto.
Khazad is a 128-bit key, 64-bit block cipher. Designed by Vincent
Rijmen and Paulo S. L. M. Barreto, Khazad is a NESSIE finalist for
legacy-level block ciphers. Khazad has many similarities with Rijndael,
and has an extremely high rate of diffusion.
This module supports the Crypt::CBC interface, with the following
functions.
=head2 Functions
=over
#!/usr/local/bin/perl
use diagnostics;
use strict;
use warnings;
use Crypt::CBC; # CBC automatically loads Khazad for us
# when using Crypt::CBC, key may be of ANY length
my $key = "0123456789abcdef";
# IV must be exactly 8 bytes long
my $IV = pack "H16", 0;
my $cipher = Crypt::CBC->new({'key' => $key,
'cipher' => 'Khazad',
'iv' => $IV,
'regenerate_key' => 1,
'padding' => 'standard',
'prepend_iv' => 0
});
# when using Crypt::CBC, plaintext may be of ANY length
my $plaintext1 = "This is a test";
my $ciphertext = $cipher->encrypt($plaintext1);
my $plaintext2 = $cipher->decrypt($ciphertext);
print "Decryption OK\n" if ($plaintext1 eq $plaintext2);
=head1 MORE EXAMPLES
See B<Crypt::CBC> for more examples using CBC mode. See also the
"examples" and "t" directories for some more examples.
=head1 SEE ALSO
B<Crypt::Anubis> and B<Crypt::Misty1>
view all matches for this distribution
view release on metacpan or search on metacpan
t/Crypt-LibSCEP.t view on Meta::CPAN
iX5k7rlRcZzQ
-----END PRIVATE KEY-----";
my $enc_cakey = "-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,DD73214CD86AA97E
JoHENnOl+cfDp24t9iJz0UsJMYdMG0nEhI9FNXlOJLKNMnEv3EP7RzvC/MvKSRmD
6HNQGCuzmgRqAzCTUn+8lx0b8W1gVEnb1/OKqhv6qVBYJEKELfSaG+U6+05GYYuP
wtMAES9ijdY1IvvYwm9liJn/DqZdcBKr+41f74jzRO2Q7RA6JR5PpSpw1xvHCQ3M
7hEkXPbhRFFcKH4PiCGr4o8XUcF7gKkeSD7D5OtsqntgT5h2CgPKu7EyckWa1wdG
t/Crypt-LibSCEP.t view on Meta::CPAN
-----END CERTIFICATE-----
";
my $sig_cakey_enc = "-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-CBC,4F58E19A09903724
UsnO5Kn0ZlvwdZRvZcQoP3cRLb0I3x28sxOSBlJZrR4y5x4uYmW5huvCUf2Bd6L6
u3ylfXoKVaCdKJ2tCzas0huQeG9mSA6m2D5Wm2y37iyjqtUbI52cMFQOM5qdOrEJ
2cLVHVjNvDxFuRSbIpTeLuABIEtEOkxkJAfe5Uns6iNcg65p95OokwCq3v4+NKGS
6AmkcznuL2l75ITHntYBCiDtoHWRXDm4QioM8hV/T+CxtdWttHz3G6TeQ/XdDicq
view all matches for this distribution
view release on metacpan or search on metacpan
#define MCRYPT_ENIGMA "enigma"
#define MCRYPT_ARCFOUR "arcfour"
#define MCRYPT_WAKE "wake"
/* Modes */
#define MCRYPT_CBC "cbc"
#define MCRYPT_ECB "ecb"
#define MCRYPT_CFB "cfb"
#define MCRYPT_OFB "ofb"
#define MCRYPT_nOFB "nofb"
#define MCRYPT_STREAM "stream"
view all matches for this distribution
view release on metacpan or search on metacpan
__END__
=head1 NAME
Crypt::Loki97 - Crypt::CBC compliant block cipher
=head1 SYNOPSIS
use Crypt::Loki97;
The default key length in this implementation is 128 bits.
Loki97 was one of the 15 candidates for the AES.
This module supports the Crypt::CBC interface, with the following
functions.
=head2 Functions
=over
#!/usr/local/bin/perl
use diagnostics;
use strict;
use warnings;
use Crypt::CBC; # CBC automatically loads Loki97 for us
# when using Crypt::CBC, key may be of ANY length
my $key = "0123456789abcdef";
# IV must be exactly 16 bytes long
my $IV = pack "H32", 0;
my $cipher = Crypt::CBC->new({'key' => $key,
'cipher' => 'Loki97',
'iv' => $IV,
'regenerate_key' => 1,
'padding' => 'standard',
'prepend_iv' => 0
});
# when using Crypt::CBC, plaintext may be of ANY length
my $plaintext1 = "This is a test";
my $ciphertext = $cipher->encrypt($plaintext1);
my $plaintext2 = $cipher->decrypt($ciphertext);
print "Decryption OK\n" if ($plaintext1 eq $plaintext2);
=head1 MORE EXAMPLES
See B<Crypt::CBC> for more examples using CBC mode. See also the
"examples" and "t" directories for some more examples.
=head1 SEE ALSO
B<Crypt::Khazad>, B<Crypt::Misty1>, B<Crypt::Anubis>,
view all matches for this distribution
view release on metacpan or search on metacpan
ca-certificates.crt view on Meta::CPAN
A4IBAQCDld3QdwdCZqXldjxNjr2xNO+kYt3LGyaiOl9QmEe7VvrFOYZt2yPntFEK
4RBaPUDkohrrF4MiOCXm5u0+q4WNg4SQS104Jf32nmNuOUjKbVOXoB3SEVuPx5z0
B+s7QkHtkQp+9H0wkE4f/cU2bMtLT0M29yfJxO2x6PwOepUR5w4xzKYfQrcUaYyj
mg5Myzqtl4weqt2iUpdUB9E+yALbM8wHv3rxXoAr9r3vcAyJeMl7gNfZ8W0Rk53q
jZcC9l4DLXLcOplp/L5JeS5R5dcxD44BBIeEksmmYlIZhueGmrLLYu22xCln/RMU
PDCBC5nFDqG+sBr7jVC6+MemssBp
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIC2zCCAcOgAwIBAAIBADANBgkqhkiG9w0BAQQFADAtMQswCQYDVQQGEwJhdTEe
MBwGA1UEChMVU2VjdXJlTmV0IENBIFNHQyBSb290MCYXETk5MDYzMDAwMDAwMCsx
MDAwFxEwOTEwMTUyMzU5MDArMTAwMDAtMQswCQYDVQQGEwJhdTEeMBwGA1UEChMV
ca-certificates.crt view on Meta::CPAN
ZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFBlcnNvbmFsIEJhc2lj
IENBMSgwJgYJKoZIhvcNAQkBFhlwZXJzb25hbC1iYXNpY0B0aGF3dGUuY29tMB4X
DTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgcsxCzAJBgNVBAYTAlpBMRUw
EwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE
ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQZXJzb25hbCBCYXNpYyBD
QTEoMCYGCSqGSIb3DQEJARYZcGVyc29uYWwtYmFzaWNAdGhhd3RlLmNvbTCBnzAN
BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLyTU23AUE+CFeZIlDWmWr5vQvoPR+53
dXLdjUmbllegeNTKP1GzaQuRdhciB5dqxFGTS+CN7zeVoQxN2jSQHReJl+A1OFdK
wPQIcOk8RHtQfmGakOMj04gRRif1CwcOu93RfyAKiLlWCy4cgNrx454p7xS9CkT7
G1sY0b8jkyECAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/MatrixSSL3.pm view on Meta::CPAN
SSL_NULL_WITH_NULL_NULL
SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_IDEA_CBC_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DH_anon_WITH_RC4_128_MD5
SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_DH_anon_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DH_anon_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_SEED_CBC_SHA
TLS_PSK_WITH_AES_128_CBC_SHA
TLS_PSK_WITH_AES_128_CBC_SHA256
TLS_PSK_WITH_AES_256_CBC_SHA384
TLS_PSK_WITH_AES_256_CBC_SHA
TLS_DHE_PSK_WITH_AES_128_CBC_SHA
TLS_DHE_PSK_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
lib/Crypt/MatrixSSL3.pm view on Meta::CPAN
# Define the following to enable various cipher suites
# At least one of these must be defined. If multiple are defined,
# the handshake will determine which is best for the connection.
#
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA256
# Pre-Shared Key Ciphers
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_PSK_WITH_AES_256_CBC_SHA
TLS_PSK_WITH_AES_128_CBC_SHA
TLS_PSK_WITH_AES_256_CBC_SHA384
TLS_PSK_WITH_AES_128_CBC_SHA256
# Ephemeral ECC DH keys, ECC DSA certificates
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
# Ephemeral ECC DH keys, RSA certificates
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
# Non-Ephemeral ECC DH keys, ECC DSA certificates
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
# Non-Ephemeral ECC DH keys, RSA certificates
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
#******************************************************************************
#
# These cipher suites are secure, but not in general use. Enable only if
# specifically required by application.
#
TLS_DHE_PSK_WITH_AES_256_CBC_SHA
TLS_DHE_PSK_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
#******************************************************************************
#
# These cipher suites are generally considered weak, not recommended for use.
#
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_SEED_CBC_SHA
SSL_RSA_WITH_RC4_128_SHA
SSL_RSA_WITH_RC4_128_MD5
#******************************************************************************
#
# These cipher suites do not combine authentication and encryption and
# are not recommended for use-cases that require strong security or
# Man-in-the-Middle protection.
#
TLS_DH_anon_WITH_AES_256_CBC_SHA
TLS_DH_anon_WITH_AES_128_CBC_SHA
SSL_DH_anon_WITH_3DES_EDE_CBC_SHA
SSL_DH_anon_WITH_RC4_128_MD5
SSL_RSA_WITH_NULL_SHA
SSL_RSA_WITH_NULL_MD5
# Other
SSL_NULL_WITH_NULL_NULL
TLS_RSA_WITH_IDEA_CBC_SHA
Flag for matrixSslEncodeRehandshake():
SSL_OPTION_FULL_HANDSHAKE
view all matches for this distribution
view release on metacpan or search on metacpan
__END__
=head1 NAME
Crypt::Misty1 - Crypt::CBC-compliant block cipher
=head1 ABSTRACT
Misty1 is a 128-bit key, 64-bit block cipher. Designed by Mitsuru
Matsui, the inventor of linear cryptanalysis, Misty1 is the first
In January of 2000, the 3GPP consortium selected a variant of Misty1,
dubbed as KASUMI (the Japanese word for ``misty''), as the mandatory
cipher in W-CDMA.
This module supports the Crypt::CBC interface, with the following
functions.
=head2 Functions
=over
#!/usr/local/bin/perl
use diagnostics;
use strict;
use warnings;
use Crypt::CBC; # CBC automatically loads Misty1 for us
# when using Crypt::CBC, key may be of ANY length
my $key = "0123456789abcdef";
# IV must be exactly 8 bytes long
my $IV = pack "H16", 0;
my $cipher = Crypt::CBC->new({'key' => $key,
'cipher' => 'Misty1',
'iv' => $IV,
'regenerate_key' => 1,
'padding' => 'standard',
'prepend_iv' => 0
});
# when using Crypt::CBC, plaintext may be of ANY length
my $plaintext1 = "This is a test";
my $ciphertext = $cipher->encrypt($plaintext1);
my $plaintext2 = $cipher->decrypt($ciphertext);
print "Decryption OK\n" if ($plaintext1 eq $plaintext2);
=head1 MORE EXAMPLES
See B<Crypt::CBC> for more examples using CBC mode. See also the
"examples" and "t" directories for some more examples.
=head1 COPYRIGHT AND LICENSE
Copyright 2003 by Julius C. Duque <jcduque (AT) lycos (DOT) com>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Mode/CBC/Easy.pm view on Meta::CPAN
use strict;
package Crypt::Mode::CBC::Easy;
#ABSTRACT: Encrypts/decrypts text and verifies decrypted text with a checksum and a random initialization vector.
$Crypt::Mode::CBC::Easy::VERSION = '0.006';
use Mouse;
use Crypt::CBC;
use Digest::SHA;
use MIME::Base64;
use Bytes::Random::Secure qw//;
use Crypt::Mode::CBC;
use Carp;
lib/Crypt/Mode/CBC/Easy.pm view on Meta::CPAN
required => 1,
);
has crypt_mode_cbc => (
isa => 'Crypt::Mode::CBC',
is => 'ro',
required => 1,
default => sub { Crypt::Mode::CBC->new('Twofish') },
);
has block_size => (
isa => 'Int',
lib/Crypt/Mode/CBC/Easy.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
Crypt::Mode::CBC::Easy - Encrypts/decrypts text and verifies decrypted text with a checksum and a random initialization vector.
=head1 VERSION
version 0.006
=head1 SYNOPSIS
my $crypt = Crypt::Mode::CBC::Easy->new(key => $bytes);
my $cipher_text = $crypt->encrypt("hello");
print "Cipher text: $cipher_text\n";
my $plain_text = $crypt->decrypt($cipher_text);
lib/Crypt/Mode/CBC/Easy.pm view on Meta::CPAN
print "Plain text: $plain_text\n";
=head1 DESCRIPTION
A convenience class that wraps L<Crypt::Mode::CBC> and adds random initialization vector support along with
a checksum to make sure that all decrypted text has not been tampered with.
=head1 METHODS
=head2 key
lib/Crypt/Mode/CBC/Easy.pm view on Meta::CPAN
The key that will be used for encrypting and decrypting. The key should be the appropriate length for the L<Crypt::Cipher> used with
L</crypt_mode_cbc>. For the default L<Crypt::Cipher> used, Twofish, the key should be 128/192/256 bits.
=head2 crypt_mode_cbc
Sets the L<Crypt::Mode::CBC> that will be used for encryption. Make sure if you change this that you set L</block_size> to the
correct value for the L<Crypt::Cipher> you have chosen. The default value uses L<Crypt::Cipher::Twofish>.
=head2 block_size
Sets the block size for the L<Crypt::Cipher> that is used. Default is 16, because this is the block size for L<Crypt::Cipher::Twofish>.
=head2 checksum_digest_hex
This is a subroutine reference to the digest hex that will be used for the checksum.
my $crypt = Crypt::Mode::CBC::Easy->new(key => $bytes, checksum_digest_hex => \&Digest::SHA::sha256_hex);
Default is L<Digest::SHA::sha512_hex|Digest::SHA>.
=head2 bytes_random_secure
view all matches for this distribution
view release on metacpan or search on metacpan
certs/root.ca view on Meta::CPAN
Firmaprofesional Root CA
========================
-----BEGIN CERTIFICATE-----
MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT
GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp
Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA
ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL
MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT
OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2
ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V
j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH
lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_ALLOWED
SSL_AT_MD5_WITH_RSA_ENCRYPTION
SSL_BYPASS_PKCS11
SSL_CBP_SSL3
SSL_CBP_TLS1_0
SSL_CK_DES_192_EDE3_CBC_WITH_MD5
SSL_CK_DES_64_CBC_WITH_MD5
SSL_CK_IDEA_128_CBC_WITH_MD5
SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5
SSL_CK_RC2_128_CBC_WITH_MD5
SSL_CK_RC4_128_EXPORT40_WITH_MD5
SSL_CK_RC4_128_WITH_MD5
SSL_CT_X509_CERTIFICATE
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
SSL_DHE_DSS_WITH_DES_CBC_SHA
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_RSA_WITH_DES_CBC_SHA
SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5
SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA
SSL_DH_ANON_WITH_DES_CBC_SHA
SSL_DH_ANON_WITH_RC4_128_MD5
SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA
SSL_DH_DSS_WITH_DES_CBC_SHA
SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DH_RSA_WITH_DES_CBC_SHA
SSL_ENABLE_FDX
SSL_ENABLE_SESSION_TICKETS
SSL_ENABLE_SSL2
SSL_ENABLE_SSL3
SSL_ENABLE_TLS
SSL_EN_DES_192_EDE3_CBC_WITH_MD5
SSL_EN_DES_64_CBC_WITH_MD5
SSL_EN_IDEA_128_CBC_WITH_MD5
SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5
SSL_EN_RC2_128_CBC_WITH_MD5
SSL_EN_RC4_128_EXPORT40_WITH_MD5
SSL_EN_RC4_128_WITH_MD5
SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA
SSL_FORTEZZA_DMS_WITH_NULL_SHA
SSL_FORTEZZA_DMS_WITH_RC4_128_SHA
SSL_HANDSHAKE_AS_CLIENT
SSL_HANDSHAKE_AS_SERVER
SSL_HL_CLIENT_CERTIFICATE_HBYTES
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_REQUIRE_FIRST_HANDSHAKE
SSL_REQUIRE_NEVER
SSL_REQUIRE_NO_ERROR
SSL_RESTRICTED
SSL_ROLLBACK_DETECTION
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA
SSL_RSA_FIPS_WITH_DES_CBC_SHA
SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA
SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_IDEA_CBC_SHA
SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_SECURITY
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_SECURITY_STATUS_OFF
SSL_SECURITY_STATUS_ON_HIGH
SSL_SECURITY_STATUS_ON_LOW
SSL_SOCKS
SSL_V2_COMPATIBLE_HELLO
TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA
TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA
TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA
TLS_DHE_DSS_WITH_RC4_128_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_ANON_WITH_AES_128_CBC_SHA
TLS_DH_ANON_WITH_AES_256_CBC_SHA
TLS_DH_ANON_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_ANON_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA
TLS_DH_DSS_WITH_AES_256_CBC_SHA
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_RSA_WITH_AES_128_CBC_SHA
TLS_DH_RSA_WITH_AES_256_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_NULL_SHA
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_NULL_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDH_ECDSA_WITH_NULL_SHA
TLS_ECDH_ECDSA_WITH_RC4_128_SHA
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_NULL_SHA
TLS_ECDH_RSA_WITH_RC4_128_SHA
TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_anon_WITH_AES_128_CBC_SHA
TLS_ECDH_anon_WITH_AES_256_CBC_SHA
TLS_ECDH_anon_WITH_NULL_SHA
TLS_ECDH_anon_WITH_RC4_128_SHA
TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA
TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
);
our %EXPORT_TAGS = (
ssl => [qw(
SSL_ALLOWED
SSL_AT_MD5_WITH_RSA_ENCRYPTION
SSL_BYPASS_PKCS11
SSL_CBP_SSL3
SSL_CBP_TLS1_0
SSL_CK_DES_192_EDE3_CBC_WITH_MD5
SSL_CK_DES_64_CBC_WITH_MD5
SSL_CK_IDEA_128_CBC_WITH_MD5
SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5
SSL_CK_RC2_128_CBC_WITH_MD5
SSL_CK_RC4_128_EXPORT40_WITH_MD5
SSL_CK_RC4_128_WITH_MD5
SSL_CT_X509_CERTIFICATE
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
SSL_DHE_DSS_WITH_DES_CBC_SHA
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DHE_RSA_WITH_DES_CBC_SHA
SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5
SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA
SSL_DH_ANON_WITH_DES_CBC_SHA
SSL_DH_ANON_WITH_RC4_128_MD5
SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA
SSL_DH_DSS_WITH_DES_CBC_SHA
SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA
SSL_DH_RSA_WITH_DES_CBC_SHA
SSL_ENABLE_FDX
SSL_ENABLE_SESSION_TICKETS
SSL_ENABLE_SSL2
SSL_ENABLE_SSL3
SSL_ENABLE_TLS
SSL_EN_DES_192_EDE3_CBC_WITH_MD5
SSL_EN_DES_64_CBC_WITH_MD5
SSL_EN_IDEA_128_CBC_WITH_MD5
SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5
SSL_EN_RC2_128_CBC_WITH_MD5
SSL_EN_RC4_128_EXPORT40_WITH_MD5
SSL_EN_RC4_128_WITH_MD5
SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA
SSL_FORTEZZA_DMS_WITH_NULL_SHA
SSL_FORTEZZA_DMS_WITH_RC4_128_SHA
SSL_HANDSHAKE_AS_CLIENT
SSL_HANDSHAKE_AS_SERVER
SSL_HL_CLIENT_CERTIFICATE_HBYTES
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_REQUIRE_FIRST_HANDSHAKE
SSL_REQUIRE_NEVER
SSL_REQUIRE_NO_ERROR
SSL_RESTRICTED
SSL_ROLLBACK_DETECTION
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA
SSL_RSA_FIPS_WITH_DES_CBC_SHA
SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA
SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_IDEA_CBC_SHA
SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_SECURITY
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_SECURITY_STATUS_OFF
SSL_SECURITY_STATUS_ON_HIGH
SSL_SECURITY_STATUS_ON_LOW
SSL_SOCKS
SSL_V2_COMPATIBLE_HELLO
TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA
TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA
TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA
TLS_DHE_DSS_WITH_RC4_128_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_ANON_WITH_AES_128_CBC_SHA
TLS_DH_ANON_WITH_AES_256_CBC_SHA
TLS_DH_ANON_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_ANON_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA
TLS_DH_DSS_WITH_AES_256_CBC_SHA
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_RSA_WITH_AES_128_CBC_SHA
TLS_DH_RSA_WITH_AES_256_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_NULL_SHA
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_NULL_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDH_ECDSA_WITH_NULL_SHA
TLS_ECDH_ECDSA_WITH_RC4_128_SHA
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_NULL_SHA
TLS_ECDH_RSA_WITH_RC4_128_SHA
TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_anon_WITH_AES_128_CBC_SHA
TLS_ECDH_anon_WITH_AES_256_CBC_SHA
TLS_ECDH_anon_WITH_NULL_SHA
TLS_ECDH_anon_WITH_RC4_128_SHA
TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA
TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
)],
);
use constant {
SSL_ALLOWED => 1, #
SSL_AT_MD5_WITH_RSA_ENCRYPTION => 0x01, #
SSL_BYPASS_PKCS11 => 16, # use PKCS#11 for pub key only
SSL_CBP_SSL3 => 0x0001, # test SSL v3 mechanisms
SSL_CBP_TLS1_0 => 0x0002, # test TLS v1.0 mechanisms
SSL_CK_DES_192_EDE3_CBC_WITH_MD5 => 0x07, #
SSL_CK_DES_64_CBC_WITH_MD5 => 0x06, #
SSL_CK_IDEA_128_CBC_WITH_MD5 => 0x05, #
SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 => 0x04, #
SSL_CK_RC2_128_CBC_WITH_MD5 => 0x03, #
SSL_CK_RC4_128_EXPORT40_WITH_MD5 => 0x02, #
SSL_CK_RC4_128_WITH_MD5 => 0x01, #
SSL_CT_X509_CERTIFICATE => 0x01, #
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA => 0x0011, #
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA => 0x0013, #
SSL_DHE_DSS_WITH_DES_CBC_SHA => 0x0012, #
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA => 0x0014, #
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA => 0x0016, #
SSL_DHE_RSA_WITH_DES_CBC_SHA => 0x0015, #
SSL_DH_ANON_EXPORT_WITH_DES40_CBC_SHA => 0x0019, #
SSL_DH_ANON_EXPORT_WITH_RC4_40_MD5 => 0x0017, #
SSL_DH_ANON_WITH_3DES_EDE_CBC_SHA => 0x001b, #
SSL_DH_ANON_WITH_DES_CBC_SHA => 0x001a, #
SSL_DH_ANON_WITH_RC4_128_MD5 => 0x0018, #
SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA => 0x000b, #
SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA => 0x000d, #
SSL_DH_DSS_WITH_DES_CBC_SHA => 0x000c, #
SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA => 0x000e, #
SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA => 0x0010, #
SSL_DH_RSA_WITH_DES_CBC_SHA => 0x000f, #
SSL_ENABLE_FDX => 11, # permit simultaneous read/write
SSL_ENABLE_SESSION_TICKETS => 18, # Enable TLS SessionTicket
SSL_ENABLE_SSL2 => 7, # enable ssl v2 (on by default)
SSL_ENABLE_SSL3 => 8, # enable ssl v3 (on by default)
SSL_ENABLE_TLS => 13, # enable TLS (on by default)
SSL_EN_DES_192_EDE3_CBC_WITH_MD5 => 0xFF07, #
SSL_EN_DES_64_CBC_WITH_MD5 => 0xFF06, #
SSL_EN_IDEA_128_CBC_WITH_MD5 => 0xFF05, #
SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5 => 0xFF04, #
SSL_EN_RC2_128_CBC_WITH_MD5 => 0xFF03, #
SSL_EN_RC4_128_EXPORT40_WITH_MD5 => 0xFF02, #
SSL_EN_RC4_128_WITH_MD5 => 0xFF01, #
SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA => 0x001d, # deprecated
SSL_FORTEZZA_DMS_WITH_NULL_SHA => 0x001c, # deprecated
SSL_FORTEZZA_DMS_WITH_RC4_128_SHA => 0x001e, # deprecated
SSL_HANDSHAKE_AS_CLIENT => 5, # force accept to hs as client
SSL_HANDSHAKE_AS_SERVER => 6, # force connect to hs as server
SSL_HL_CLIENT_CERTIFICATE_HBYTES => 6, #
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_REQUIRE_FIRST_HANDSHAKE => 2, #
SSL_REQUIRE_NEVER => 0, #
SSL_REQUIRE_NO_ERROR => 3, #
SSL_RESTRICTED => 2, # only with "Step-Up" certs.
SSL_ROLLBACK_DETECTION => 14, # for compatibility, default: on
SSL_RSA_EXPORT_WITH_DES40_CBC_SHA => 0x0008, #
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 => 0x0006, #
SSL_RSA_EXPORT_WITH_RC4_40_MD5 => 0x0003, #
SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA => 0xfeff, #
SSL_RSA_FIPS_WITH_DES_CBC_SHA => 0xfefe, #
SSL_RSA_OLDFIPS_WITH_3DES_EDE_CBC_SHA => 0xffe0, #
SSL_RSA_OLDFIPS_WITH_DES_CBC_SHA => 0xffe1, #
SSL_RSA_WITH_3DES_EDE_CBC_SHA => 0x000a, #
SSL_RSA_WITH_DES_CBC_SHA => 0x0009, #
SSL_RSA_WITH_IDEA_CBC_SHA => 0x0007, #
SSL_RSA_WITH_NULL_MD5 => 0x0001, #
SSL_RSA_WITH_NULL_SHA => 0x0002, #
SSL_RSA_WITH_RC4_128_MD5 => 0x0004, #
SSL_RSA_WITH_RC4_128_SHA => 0x0005, #
SSL_SECURITY => 1, # (on by default)
lib/Crypt/NSS/Constants.pm view on Meta::CPAN
SSL_SECURITY_STATUS_OFF => 0, #
SSL_SECURITY_STATUS_ON_HIGH => 1, #
SSL_SECURITY_STATUS_ON_LOW => 2, #
SSL_SOCKS => 2, # (off by default)
SSL_V2_COMPATIBLE_HELLO => 12, # send v3 client hello in v2 fmt
TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA => 0x0063, #
TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA => 0x0065, #
TLS_DHE_DSS_WITH_AES_128_CBC_SHA => 0x0032, #
TLS_DHE_DSS_WITH_AES_256_CBC_SHA => 0x0038, #
TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA => 0x0044, #
TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA => 0x0087, #
TLS_DHE_DSS_WITH_RC4_128_SHA => 0x0066, #
TLS_DHE_RSA_WITH_AES_128_CBC_SHA => 0x0033, #
TLS_DHE_RSA_WITH_AES_256_CBC_SHA => 0x0039, #
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA => 0x0045, #
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA => 0x0088, #
TLS_DH_ANON_WITH_AES_128_CBC_SHA => 0x0034, #
TLS_DH_ANON_WITH_AES_256_CBC_SHA => 0x003A, #
TLS_DH_ANON_WITH_CAMELLIA_128_CBC_SHA => 0x0046, #
TLS_DH_ANON_WITH_CAMELLIA_256_CBC_SHA => 0x0089, #
TLS_DH_DSS_WITH_AES_128_CBC_SHA => 0x0030, #
TLS_DH_DSS_WITH_AES_256_CBC_SHA => 0x0036, #
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA => 0x0042, #
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA => 0x0085, #
TLS_DH_RSA_WITH_AES_128_CBC_SHA => 0x0031, #
TLS_DH_RSA_WITH_AES_256_CBC_SHA => 0x0037, #
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA => 0x0043, #
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA => 0x0086, #
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA => 0xC008, #
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA => 0xC009, #
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA => 0xC00A, #
TLS_ECDHE_ECDSA_WITH_NULL_SHA => 0xC006, #
TLS_ECDHE_ECDSA_WITH_RC4_128_SHA => 0xC007, #
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA => 0xC012, #
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA => 0xC013, #
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA => 0xC014, #
TLS_ECDHE_RSA_WITH_NULL_SHA => 0xC010, #
TLS_ECDHE_RSA_WITH_RC4_128_SHA => 0xC011, #
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA => 0xC003, #
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA => 0xC004, #
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA => 0xC005, #
TLS_ECDH_ECDSA_WITH_NULL_SHA => 0xC001, #
TLS_ECDH_ECDSA_WITH_RC4_128_SHA => 0xC002, #
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA => 0xC00D, #
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA => 0xC00E, #
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA => 0xC00F, #
TLS_ECDH_RSA_WITH_NULL_SHA => 0xC00B, #
TLS_ECDH_RSA_WITH_RC4_128_SHA => 0xC00C, #
TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA => 0xC017, #
TLS_ECDH_anon_WITH_AES_128_CBC_SHA => 0xC018, #
TLS_ECDH_anon_WITH_AES_256_CBC_SHA => 0xC019, #
TLS_ECDH_anon_WITH_NULL_SHA => 0xC015, #
TLS_ECDH_anon_WITH_RC4_128_SHA => 0xC016, #
TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA => 0x0062, #
TLS_RSA_EXPORT1024_WITH_RC4_56_SHA => 0x0064, #
TLS_RSA_WITH_AES_128_CBC_SHA => 0x002F, #
TLS_RSA_WITH_AES_256_CBC_SHA => 0x0035, #
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA => 0x0041, #
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA => 0x0084, #
};
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
=head1 DESCRIPTION
The NULL Encryption Algorithm is a symmetric block cipher described in
RFC 2410 by Rob Glenn and Stephen Kent.
This module implements NULL encryption. It supports the Crypt::CBC
interface, with the following functions.
=head2 Functions
=over
=back
=head1 SEE ALSO
Crypt::CBC, Crypt::TEA, Crypt::Twofish
=head1 AUTHOR
Abhijit Menon-Sen <ams@wiw.org>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/NamedKeys.pm view on Meta::CPAN
use warnings;
use Moo;
=head1 NAME
Crypt::NamedKeys - A Crypt::CBC wrapper with key rotation support
=head1 SYNOPSYS
use Crypt::NamedKeys;
my $crypt = Crypt::NamedKeys->new(keyname => 'href');
lib/Crypt/NamedKeys.pm view on Meta::CPAN
associated with the cyphertext, so we use this key.
=cut
use Carp;
use Crypt::CBC;
use Digest::SHA qw(hmac_sha256_base64 sha256);
use Encode;
use JSON::MaybeXS;
use MIME::Base64;
use String::Compare::ConstantTime;
lib/Crypt/NamedKeys.pm view on Meta::CPAN
sub encrypt_data {
my ($self, %args) = @_;
croak "data argument is required and must be a reference" unless $args{data} and ref $args{data};
my $json_data = Encode::encode_utf8($json->encode($args{data}));
my $cypher = $args{cypher} || 'Rijndael';
# Crypt::CBC generates random 8 bytes salt that it uses to
# derive IV and encryption key from $args{secret}. It uses
# the same algorythm as OpenSSL, the output is identical to
# openssl enc -e -aes-256-cbc -k $args{secret} -salt
my $cbc = Crypt::CBC->new(
-key => &$get_secret(
keyname => $self->keyname,
keynum => $self->keynum,
),
-cipher => $cypher,
lib/Crypt/NamedKeys.pm view on Meta::CPAN
keynum => $keynum,
keyname => $self->keyname,
));
return unless String::Compare::ConstantTime::equals($msg_mac, $args{mac});
my $cbc = Crypt::CBC->new(
-key => &$get_secret(
keynum => $keynum,
keyname => $self->keyname
),
-cipher => 'Rijndael',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/Nettle/Cipher.pm view on Meta::CPAN
If $is_encrypt is 'decrypt' or 0, the new object will do decryption;
If $is_encrypt is 'encrypt' or 1, it will encrypt.
You can set the $mode of the cipher with 'ecb' (Electronic Code Book),
'cbc' (Cipher Block Chaining), or 'ctr' (Counter). ECB is the default
because it is simpler to configure, but you probably want CBC or CTR
for security.
If you use CBC or CTR, you'll need to supply an initialization vector
(CBC) or initialization counter (CTR) in the $iv parameter. $iv
should be the size of block_size().
On error, will return undefined.
Supported encryption algorithms are: aes128, aes192, aes256, arctwo40,
view all matches for this distribution
view release on metacpan or search on metacpan
__END__
=head1 NAME
Crypt::Noekeon - Crypt::CBC-compliant block cipher
=head1 ABSTRACT
Noekeon is a 128-bit key, 128-bit block cipher designed by Joan Daemen,
Michael Peeters, Vincent Rijmen, and Gilles Van Assche. Noekeon was
Noekeon is a 128-bit key, 128-bit block cipher designed by Joan Daemen,
Michael Peeters, Vincent Rijmen, and Gilles Van Assche. Noekeon was
submitted as a NESSIE candidate.
This module supports the Crypt::CBC interface, with the following
functions.
=head2 Functions
=over
#!/usr/local/bin/perl
use diagnostics;
use strict;
use warnings;
use Crypt::CBC; # CBC automatically loads Noekeon for us
# when using Crypt::CBC, key may be of ANY length
my $key = "0123456789abcdef";
# IV must be exactly 16 bytes long
my $IV = pack "H32", 0;
my $cipher = Crypt::CBC->new({'key' => $key,
'cipher' => 'Noekeon',
'iv' => $IV,
'regenerate_key' => 1,
'padding' => 'standard',
'prepend_iv' => 0
});
# when using Crypt::CBC, plaintext may be of ANY length
my $plaintext1 = "This is a test";
my $ciphertext = $cipher->encrypt($plaintext1);
my $plaintext2 = $cipher->decrypt($ciphertext);
print "Decryption OK\n" if ($plaintext1 eq $plaintext2);
=head1 MORE EXAMPLES
See B<Crypt::CBC> for more examples using CBC mode. See also the
"examples" and "t" directories for some more examples.
=head1 SEE ALSO
B<Crypt::Khazad>, B<Crypt::Anubis> and B<Crypt::Misty1>
view all matches for this distribution
view release on metacpan or search on metacpan
Kang-min Liu <gugod@gugod.org>.
=head1 SEE ALSO
perl(1), Crypt::DES(3), Crypt::IDEA(3), Crypt::CBC(3), Crypt::ECB(3)
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
# Basic usage (defaults to AES-ECB based on key length; ECB is not recommended)
my $key = urandom(32);
my $cipher = Crypt::OpenSSL::AES->new($key);
# Recommended usage: AES-256-CBC with proper Initialization Vector and Padding
my $secure_key = urandom(32); # 32 bytes (256 bits) for AES-256
my $iv = urandom(16); # 16 bytes (128 bits) block size for AES
my $secure_cipher = Crypt::OpenSSL::AES->new(
$secure_key,
{
cipher => 'AES-256-CBC',
iv => $iv,
padding => 1, # 1 for standard block padding, 0 for no padding
}
);
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
This module implements a wrapper around OpenSSL. Specifically, it
wraps the methods related to the US Government's Advanced
Encryption Standard (the Rijndael algorithm). The original version
supports only AES ECB (electronic codebook mode encryption).
This module is compatible with Crypt::CBC (and likely other modules
that utilize a block cipher to make a stream cipher).
This module is an alternative to the implementation provided by
Crypt::Rijndael which implements AES itself. In contrast, this module
is simply a wrapper around the OpenSSL library.
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
=item AES-128-ECB, AES-192-ECB and AES-256-ECB (no IV)
Supports padding
=item AES-128-CBC, AES-192-CBC and AES-256-CBC
Supports padding and iv
=back
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
When using OpenSSL 3.0+ built with FIPS support, pass C<provider_props => 'fips=yes'>
to the constructor to ensure only FIPS-validated algorithm implementations are used.
B<AES-ECB is not approved for general data encryption under FIPS 140-3.>
Use AES-CBC or AES-CTR with a random IV instead.
my $cipher = Crypt::OpenSSL::AES->new($key, {
cipher => 'AES-256-CBC',
iv => $iv,
padding => 1,
provider_props => 'fips=yes',
});
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
# 16-bytes (128-bits) AES-128-xxx
# 24-bytes (192-bits) AES-192-xxx
# 32-bytes (256-bits) AES-256-xxx
my $cipher = Crypt::OpenSSL::AES->new($key,
{
cipher => 'AES-256-CBC',
iv => $iv, # (16-bytes for supported ciphers)
padding => 1, (0 - no padding, 1 - padding)
});
# cipher
# AES-128-ECB, AES-192-ECB and AES-256-ECB (no IV)
# AES-128-CBC, AES-192-CBC and AES-256-CBC
# AES-128-CFB, AES-192-CFB and AES-256-CFB
# AES-128-CTR, AES-192-CTR and AES-256-CTR
# AES-128-OFB, AES-192-OFB and AES-256-OFB
#
# iv - 16-byte random data
lib/Crypt/OpenSSL/AES.pm view on Meta::CPAN
# 0 - no padding
# 1 - padding
=item $cipher->encrypt($data)
Encrypt data. For Block Ciphers (ECB and CBC) the size of C<$data>
must be exactly C<blocksize> in length (16 bytes) B<or> padding must be
enabled in the B<new> constructor, otherwise this function will croak.
For Stream ciphers (CFB, CTR or OFB) the block size is considered to
be 1 byte and no padding is required.
Crypt::CBC is no longer required to encrypt/decrypt data of arbitrary
lengths.
=item $cipher->decrypt($data)
Decrypts data. For Block Ciphers (ECB and CBC) the size of C<$data>
must be exactly C<blocksize> in length (16 bytes) B<or> padding must be
enabled in the B<new> constructor, otherwise this function will croak.
For Stream ciphers (CFB, CTR or OFB) the block size is considered to
be 1 byte and no padding is required.
Crypt::CBC is no longer required to encrypt/decrypt data of arbitrary
lengths.
=item $cipher->fips_mode()
Will return true (1) or false (0) depending whether the openssl 'fips=yes'
default property is set.
=item keysize
This method is used by Crypt::CBC to verify the key length.
This module actually supports key lengths of 16, 24, and 32 bytes,
but this method always returns 32 for Crypt::CBC's sake.
=item blocksize
This method is used by Crypt::CBC to check the block size.
The blocksize for AES is always 16 bytes.
=back
=head2 USE WITH CRYPT::CBC
As padding is now supported for the CBC cipher, Crypt::CBC is no
longer required but supported for backward compatibility.
use Crypt::CBC;
my $plaintext = "This is a test!!";
my $password = "qwerty123";
my $cipher = Crypt::CBC->new(
-key => $password,
-cipher => "Crypt::OpenSSL::AES",
-pbkdf => 'pbkdf2',
);
my $encrypted = $cipher->encrypt($plaintext);
my $decrypted = $cipher->decrypt($encrypted);
=head1 SEE ALSO
L<Crypt::CBC>
http://www.openssl.org/
http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
view all matches for this distribution