Hello guys,
I have written functionality to encrypt and decrypt the file using perl script. Now I want to port this script to crypto++ libaray functionality.
Here is the perl script code,
//For encryption
my $cipher = Crypt::CBC->new(
-cipher => "Crypt::Rijndael",
-key => $key,
-header => 'salt',
);
$cipher->start( 'encrypting' );
while ( read( $original_file, $buffer, 1024 ) ) {
print $encrypted_file
$cipher->crypt( $buffer );
}
my $cipher = Crypt::CBC->new(
-cipher => "Crypt::Rijndael",
-key => $key,
-header => 'salt',
);
$cipher->start( 'encrypting' );
while ( read( $original_file, $buffer, 1024 ) ) {
print $encrypted_file
$cipher->crypt( $buffer );
}
To copy to clipboard, switch view to plain text mode
//For decryption
my $cipher = Crypt::CBC->new(
-cipher => "Crypt::OpenSSL::AES",
-key => $key,
-header => 'salt',
);
$cipher->start( 'decrypting' );
while ( read( $encrypted_file, $buffer, 1024 ) ) {
print $decrypted_file
$cipher->crypt( $buffer );
}
my $cipher = Crypt::CBC->new(
-cipher => "Crypt::OpenSSL::AES",
-key => $key,
-header => 'salt',
);
$cipher->start( 'decrypting' );
while ( read( $encrypted_file, $buffer, 1024 ) ) {
print $decrypted_file
$cipher->crypt( $buffer );
}
To copy to clipboard, switch view to plain text mode
I can find the alternative to Crypt::Rijndael in crypto++ lib, but what is the alternative to Crypt::OpenSSL::AES in crypto++ library.
Thanks in advance,
Bookmarks