结合 c = c &挑战中的 (1 << bit) 和 int c = passkey.charAt(i % passkey.length()

发布于 2024-12-28 20:37:33 字数 496 浏览 3 评论 0 原文

我对此感到非常困惑:

    for(i=0; i<message.length(); i++) {
        int c = passkey.charAt(i % passkey.length());
        int d = message.charAt(i);

        c = c & (1 << bit);

        result = result + (char)(c ^ d);    
    }

我知道 LyJwNh9iPil3(消息)会翻译为 ENCRYPTED(结果)。我不明白的是所使用的密钥应该是什么。目前,我陷入了困境:

L = 76 E = 69 所以结果 char = 69,所以 c 必须是 69^(1/76) = 1,05729... 但那是在第 x 位被咀嚼掉之后,并且在除以密码长度之后。

我相信我永远无法解决这个问题,我正在走的路。你能证实吗?消息中的字母数量和结果不一样,对吧?

I'm breaking my head over this :

    for(i=0; i<message.length(); i++) {
        int c = passkey.charAt(i % passkey.length());
        int d = message.charAt(i);

        c = c & (1 << bit);

        result = result + (char)(c ^ d);    
    }

I know that LyJwNh9iPil3 (message) translates to ENCRYPTED (result). What I can't figure out, is what the used passkey should be. Currently, I'm stuck at :

L = 76
E = 69
so result char = 69, so c must be 69^(1/76) = 1,05729... But that is AFTER the x-th few bits are chewed off, and after the division by the password length.

I believe I will never be able to solve this, the path I'm going. Can you confirm that? The number of letters in the message and the result is different, right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

旧时浪漫 2025-01-04 20:37:33

你错了:

69^(1/76) = 1,05729..

^是按位异或,而不是幂。

You are wrong here:

69^(1/76) = 1,05729..

^ is bitwise XOR, not power.

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