Re: Help me fix this code

2011-05-02 Thread Muhammed Shafeek
Hi Peter, Add padding for CBC mode encryption. Or u can use CFB mode. EVB_bf_cfb() -Shafeek On Sat, Apr 30, 2011 at 7:26 PM, derleader mail derlea...@abv.bg wrote: Hi, I have a problem with the code below. There is a bug that I can't find and fix. This is the output when I try to run

Re: Re: Help me fix this code

2011-05-02 Thread derleader mail
Hi Peter, Add padding for CBC mode encryption. Or u can use CFB mode. EVB_bf_cfb() -Shafeek Hi, Thank you for the reply. I have edit the code. Source Code: //gcc blowfish2.c -L/usr/local/ssl/lib/ -lssl -lcrypto -Wall #include #include #include #include #include #define

Re: Re: Help me fix this code

2011-05-02 Thread Muhammed Shafeek
Hi Peter, The extra string in o/p is due to error in coding. u r passing incorrect length in EVP_DecryptUpdate. if (!(EVP_DecryptUpdate(dctx, dec_outbuf, decoutlen, enc_outbuf, output_buf_size))) change above line to if (!(EVP_DecryptUpdate(dctx, dec_outbuf, decoutlen, enc_outbuf, encoutlen)))

Re: Re: Re: Help me fix this code

2011-05-02 Thread derleader mail
Hi Peter, The extra string in o/p is due to error in coding. u r passing incorrect length in EVP_DecryptUpdate. if (!(EVP_DecryptUpdate(amp;dctx, dec_outbuf, amp;decoutlen, enc_outbuf, output_buf_size))) change above line to if (!(EVP_DecryptUpdate(amp;dctx, dec_outbuf, amp;decoutlen,

RE: Help me fix this code

2011-05-02 Thread Dave Thompson
From: owner-openssl-us...@openssl.org On Behalf Of Muhammed Shafeek Sent: Monday, 02 May, 2011 04:48 Hi Peter, Add padding for CBC mode encryption. Or u can use CFB mode. EVB_bf_cfb() Unnecessary. EVP_bf_cbc (or EVP_*_cbc) already does PKCS5 padding. (If you