hello evenbody!
I have a problem with blowfish (ubuntu 7.04)
There are two sourcecodes:one is perl,and the other is c like this:
perl:
my $cipher = Crypt::CBC->new( -key => '[EMAIL PROTECTED]',
-cipher => 'Blowfish',
-salt => 1,
);
$ciphertext = $cipher->encrypt('will young');(so ciphertext is encrypt
code)
c:
int
do_encrypt(void)
{
int outlen, tmplen;
unsigned char key[] = "[EMAIL PROTECTED]";
unsigned char iv[8] = {0};
unsigned char outbuf[1024] = {0};
char intext[] = "will young";
EVP_CIPHER_CTX ctx;
FILE *out;
EVP_CIPHER_CTX_init(&ctx);
EVP_EncryptInit_ex(&ctx, EVP_bf_ofb(), NULL, key, iv);
if (!EVP_EncryptUpdate(&ctx, outbuf, &outlen,
intext, strlen(intext))) {
return 0;
}
if (!EVP_EncryptFinal_ex(&ctx, outbuf + outlen, &tmplen)) {
return 0;
}
outlen += tmplen;
EVP_CIPHER_CTX_cleanup(&ctx);
//so outbuf is encrypt code;
return 1;
}
but ciphertext is different from outbuf why??
I want to decrypt the result of perl by using c.
--
View this message in context:
http://www.nabble.com/problem-with-perl-c-blowfish-tf4854688.html#a13891758
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]