如何解密 IRC Bot 的河豚加密消息
我正在用 php 制作一个 IRC 机器人来读取频道的内容。机器人做得很好。但是消息是用河豚加密进行加密的。我有钥匙和所有的东西,我尝试了下面的 PHP 代码,但没有成功。
echo mcrypt_decrypt(MCRYPT_BLOWFISH,$key,$input,MCRYPT_MODE_ECB);
如需更多帮助,请通过 drftpd 站点机器人完成加密。
用 Java 编写,因此可能一些 Java 人员也可以提供帮助。
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 .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我查看了 org.drftpd.util.Blowfish,它:1)使用 ECB,2)使用 getBytes() 而不指定字符集,这两种方式都不推荐。它还在加密后进行 Base64 编码,在解密前进行 Base64 解码,因此您需要在 PHP 代码中执行相同的操作。它还使用 0 字节进行自己的填充,这是您必须自己做的另一件事。
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.