From 1cc8ed779eee1c7775d56ec35b28b85f33b23a90 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 12 Jul 2025 20:00:43 +0200 Subject: [PATCH] get rid of Crypt::GCrypt --- tools/install_modules.sh | 3 ++- tools/test_modules/m18600.pm | 32 ++++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/tools/install_modules.sh b/tools/install_modules.sh index 9b5253344..1d6f583c3 100755 --- a/tools/install_modules.sh +++ b/tools/install_modules.sh @@ -36,6 +36,7 @@ cpanm Authen::Passphrase::LANManager \ Convert::EBCDIC \ Crypt::Argon2 \ Crypt::AuthEnc::GCM \ + Crypt::Blowfish \ Crypt::Camellia \ Crypt::CBC \ Crypt::Cipher::Serpent \ @@ -46,7 +47,6 @@ cpanm Authen::Passphrase::LANManager \ Crypt::Digest::Whirlpool \ Crypt::ECB \ Crypt::Eksblowfish::Bcrypt \ - Crypt::GCrypt \ Crypt::Mode::CBC \ Crypt::Mode::ECB \ Crypt::MySQL \ @@ -61,6 +61,7 @@ cpanm Authen::Passphrase::LANManager \ Crypt::Skip32 \ Crypt::Twofish \ Crypt::UnixCrypt_XS \ + CryptX \ Data::Types \ Digest::CMAC \ Digest::CRC \ diff --git a/tools/test_modules/m18600.pm b/tools/test_modules/m18600.pm index b974ce50a..fc2c44973 100644 --- a/tools/test_modules/m18600.pm +++ b/tools/test_modules/m18600.pm @@ -8,7 +8,8 @@ use strict; use warnings; -use Crypt::GCrypt; +use Crypt::Blowfish; +use Crypt::Mode::CFB; use Crypt::PBKDF2; use Digest::SHA qw (sha1 sha1_hex); @@ -36,20 +37,9 @@ sub module_generate_hash my $pass_hash = sha1 ($word); my $key = $kdf->PBKDF2 ($b_salt, $pass_hash); - my $cfb = Crypt::GCrypt->new - ( - type => 'cipher', - algorithm => 'blowfish', - mode => 'cfb' - ); + my $cfb = Crypt::Mode::CFB->new('Blowfish'); - $cfb->start ('encrypting'); - $cfb->setkey ($key); - $cfb->setiv ($b_iv); - - my $b_cipher = $cfb->encrypt ($b_plain); - - $cfb->finish (); + my $b_cipher = $cfb->encrypt($b_plain, $key, $b_iv); my $cipher = unpack ('H*', $b_cipher); my $checksum = sha1_hex ($b_plain); @@ -113,19 +103,9 @@ sub module_verify_hash my $pass_hash = sha1 ($word); my $key = $kdf->PBKDF2 ($b_salt, $pass_hash); - my $cfb = Crypt::GCrypt->new ( - type => 'cipher', - algorithm => 'blowfish', - mode => 'cfb' - ); + my $cfb = Crypt::Mode::CFB->new('Blowfish'); - $cfb->start ('decrypting'); - $cfb->setkey ($key); - $cfb->setiv ($b_iv); - - my $b_plain = $cfb->decrypt ($b_cipher); - - $cfb->finish (); + my $b_plain = $cfb->decrypt($b_cipher, $key, $b_iv); my $plain = unpack ('H*', $b_plain);