I want to use the GOST encryption algorithm in Perl. I tried using RC4 and Blowfish and it was ok, but I'd rather use GOST and Elijah which aren't supported by Crypt::CBC. How can I use Crypt::CBC interface for encryption and decryption with GOST?
Asked
Active
Viewed 411 times
1 Answers
3
You can pass a cipher-Object when you create your Crypt::CBC
-object. So install Crypt::GOST
from CPAN and use it there.
This works here:
#!/usr/bin/perl
use strict;
use warnings;
use Crypt::CBC;
my $cipher = Crypt::CBC->new(-key => 'test', -cipher => 'GOST');

marderh
- 1,236
- 7
- 12
-
i solve my problem in Gost every algorythm for adding to cbc must contain this subrutin new() encrypt() blocksize() keysize() decrypt(), but i have problem with adding TEA : tiny Encripted Algorythm i cant find a true implementaion of this algorythm in perl what i must do? – User123422 Aug 20 '13 at 10:41
-
i download tea from this link :https://metacpan.org/module/Crypt::TEA but this cod content a rutin that does not implemented in it such as Crypt::TEA::setup($key, $rounds || 32) what i must do? – User123422 Aug 20 '13 at 10:44
-
just install Crypt::TEA from CPAN and you can use it like the others: `my $cipher = Crypt::CBC->new(-key => 'test', -cipher => 'TEA');` – marderh Aug 20 '13 at 11:15
-
but i have this error Undefined subroutine &Crypt::TEA::setup called at Crypt/TEA_PP.pm line 24,
line 1. – User123422 Aug 20 '13 at 11:42 -
You have some mess with the modules it seems. TEA_PP.pm is the wrong module i think (maybe because of [that](http://cpanratings.perl.org/dist/Crypt-Tea)). – marderh Aug 20 '13 at 11:56
-
`Crypt::TEA` and `Crypt::Tea` are apparently different modules! – marderh Aug 20 '13 at 11:57
-
you say true but when i changed TEA_PP.pm to TEA.pm i had this problrm yet i think there is not a Tiny Encrypted Algorythm in pure perl that works properly!!!!what do you think – User123422 Aug 20 '13 at 12:02
-
Possible solution would be to remove/uninstall `Crypt::Tea` and stick to Crypt::TEA, which i suppose should work as expected. – marderh Aug 20 '13 at 12:06