简体   繁体   中英

How to decrypt IRC Bot's blowfish encrypted messages

I am making an IRC bot in php to read content of a channel. Bot is done fine.But the messages are encrypted With blowfish encryption. i have the key and all, i tried PHP's code below but didn;t worked.

echo mcrypt_decrypt(MCRYPT_BLOWFISH,$key,$input,MCRYPT_MODE_ECB);

For more help the encryption is done via drftpd site bot.

I can find this link http://trac.drftpd.org/browser/branches/jpf/src/plugins/org.drftpd.plugins.sitebot/src/org/drftpd/plugins/sitebot/OutputWriter.java?rev=1721

Written in Java so may be some Java guy can help too .

I looked at org.drftpd.util.Blowfish and it: 1) uses ECB, and 2) uses getBytes() without specifying a charset, both of which are not recommended. It also base64 encodes after encrypting and base64 decodes prior to decrypting, so you'll need to do the same in your PHP code. It also does its own padding with 0 bytes, another thing you'll have to do yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM