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

发布于 2024-09-04 04:04:15 字数 605 浏览 11 评论 0原文

我正在用 php 制作一个 IRC 机器人来读取频道的内容。机器人做得很好。但是消息是用河豚加密进行加密的。我有钥匙和所有的东西,我尝试了下面的 PHP 代码,但没有成功。

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

如需更多帮助,请通过 drftpd 站点机器人完成加密。

我可以找到此链接http://trac.drftpd.org/browser/branches/jpf/src/plugins/org.drftpd.plugins.sitebot/src/org/drftpd/plugins/sitebot /OutputWriter.java?rev=1721

用 Ja​​va 编写,因此可能一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风和你 2024-09-11 04:04:15

我查看了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文