简体   繁体   English

如何解密IRC Bot的河豚加密消息

[英]How to decrypt IRC Bot's blowfish encrypted messages

I am making an IRC bot in php to read content of a channel. 我正在用PHP制作一个IRC机器人来阅读频道内容。 Bot is done fine.But the messages are encrypted With blowfish encryption. Bot做的很好,但是邮件使用河豚加密进行了加密。 i have the key and all, i tried PHP's code below but didn;t worked. 我有钥匙,所有的东西,我在下面尝试了PHP的代码,但是没有用。

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

For more help the encryption is done via drftpd site bot. 要获得更多帮助,可以通过drftpd站点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 我可以找到此链接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 . 用Java编写,所以也许有些Java人士也可以提供帮助。

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. 我看了看org.drftpd.util.Blowfish ,它是:1)使用ECB,2)使用getBytes()而不指定字符集,不推荐两者。 It also base64 encodes after encrypting and base64 decodes prior to decrypting, so you'll need to do the same in your PHP code. 它还在加密后对base64进行编码,在解密之前对base64进行解码,因此您需要在PHP代码中执行相同的操作。 It also does its own padding with 0 bytes, another thing you'll have to do yourself. 它还使用0字节自己填充,这是您必须自己做的另一件事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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