Hi,
I am looking for a coder being able to use Blowfish in C (no assembler!) and Perl. This should be trivial for someone who knows what to do!
Write a C function 'blowfish_encrypt' (see the attached example for the required parameters) which encrypts a string of arbitrary length with a passphrase of arbitrary length (max. 56 chars) using the blowfish algorithm while being re-entrant/thread safe. Use a public blowfish implementation for this! ([login to view URL] is preferred, but [login to view URL], [login to view URL] or other public available code is also accepted.) Open/Free software like GNU is explicit desired!
After the encryption of the string the result string is converted into hex representation and printed to stdout. (Hey as you see: This is already done!)
The program has to compile/run on any major Linux/Unix-System (in 32-bit and 64-bit mode!). See my example C code attached!
The hexified crypted string is then used in a Perl-script, which uses 'Crypt::CBC' and its 'Blowfish'-modul to translate that string back to the original text!
The perl-script has to be something like:
use Crypt::CBC;
my $ciphertextHexed = "The string returned by the C program on stdout";
my $cipher =
Crypt::CBC->new( -key => 'myArbitraryPassphraseWithMaxStringLenOf56', #The same as in the C program!
#do I have to specify -keylen ? Everytime? Sometimes? Never? When?
-cipher => 'Blowfish'
);
print $cipher->decrypt(pack ("H*", $ciphertextHexed));
print "\n";
The program is accepted, when it is able to encrypt in C and decrypt in Perl some text string (with text passwords) I have.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) I am allowed to do with that code what I want and so are you!
## Platform
Linux, Solaris (in 32-bit and 64-bit mode)