This is a discussion on Re: libcrypto blowfish help - ecb mode and custom base64 - Openssl ; On Mon, Oct 02, 2006 at 03:16:31PM +1300, Richard Dingwall wrote: > Hi, > > I'm trying to decrypt messages that are encrypted with Eggdrop's > blowfish encrypt() method. This method is also used by a > irssi/mirc/xchat encryption module ...
On Mon, Oct 02, 2006 at 03:16:31PM +1300, Richard Dingwall wrote:
> I'm trying to decrypt messages that are encrypted with Eggdrop's
> blowfish encrypt() method. This method is also used by a
> irssi/mirc/xchat encryption module called FiSH.
> I have already written some code to do it using libcrypto's EVP, but
> it produces gibberish output. You can see it here:
Your paste does not exist.
> (ignore the == key.length(); on EVP_BytesToKey, it was part of an
> assertion I forgot to remove).
> I have two questions.
> Firstly, I understand the eggdrop's blowfish stuff uses a custom
> base64 method. The differences from 'standard base64' RFC 2045
> (inherits RFC 1421) include:
> * The character assignments are different ("./0-9a-zA-Z" instead of
> * Encoding is done low-order to high-order in 32bit blocks, instead of
> high-order to low-order in 24bit blocks. This leaves leftovers.
> * No support for padding character (=)
> How might I use libcrypto to solve my problem?
You can't. Either copy the required code from eggdrop's code (if
permitted) or write your own.
> Secondly, it uses ECB mode, and apparently ECB mode doesn't use an IV.
> Am I initializing the key correctly?
Actually unless I am mistaken, eggdrop uses hacked mode (yack).
/* Robey: Reset blowfish boxes to initial state
* (I guess normally it just keeps scrambling them, but here it's
* important to get the same encrypted result each time)
Thus I am not convinced at all that this is even possible.
> __________________________________________________ ____________________
> OpenSSL Project http://www.openssl.org
> User Support Mailing List email@example.com
> Automated List Manager firstname.lastname@example.org
OpenSSL Project http://www.openssl.org
User Support Mailing List email@example.com
Automated List Manager firstname.lastname@example.org