使用Java对密文进行密码分析

发布于 2024-10-31 23:13:06 字数 521 浏览 0 评论 0原文

我正在寻找有关作业的一些想法。

我有 7 个密文文件,所有这些文件都使用相同的对称密钥进行加密,该密钥3 个字符长并且是字母。没有提供加密算法,但规范表明它是一种自制算法并且幼稚(无论这意味着什么)。我的目标是解密这些文件。我只是在寻找可以对这些文件进行攻击的想法。

到目前为止,我已经做了频率分析、暴力攻击来检测凯撒密码、克拉辛斯基方法来检测维吉尼亚密码、密文异或来检测简单版本的流密码。我怀疑这些文件是使用某种密码组合进行加密的。

顺便说一句,解密后的明文应该只包含一条明文消息,但密文却揭示了超过 97 个不同 ASCII 符号的使用!

非常感谢任何一般性帮助、想法或指示!老实说,我不希望解密这些文件,但我也可以在你的帮助下证明我的教授是错的。谢谢!

编辑

我正在寻找对块或流密码的攻击。至少我是这么怀疑的......

I'm looking for some ideas on an assignment.

I have 7 ciphertext files, all of which are encrypted using the same symmetric key, which is 3 characters long and is alphabetic. No encryption algorithm is provided but the specs state that it is a home-made algorithm and is naive (whatever that means). My objective is to decrypt these files. I'm merely looking for ideas on the attacks which I can carry out on these files.

So far, I have done a frequency analysis, brute force attack to detect Ceasar Cipher, Krasinsky's method to detect Vigenere Cipher, Ciphertext XOR to detect a simple version of the stream cipher. I suspect that the files were encrypted using some mix of ciphers.

By the way, the decrypted plaintext is supposed to contain just a plain message, but the ciphertext reveals the use of over 97 different ASCII symbols!

Any general help, ideas or directions are greatly appreciated! Honestly, I'm not expected to decrypt these files, but then I might as well prove my professor wrong with your help. Thanks!

EDIT

I'm looking for attacks on block or stream ciphers. At least thats what I suspect...

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

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

发布评论

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

评论(4

↘人皮目录ツ 2024-11-07 23:13:06

著名的恩尼格玛机使用 3 个字符对称字母键。 97 个 ASCII 符号? ASCII 从 32 到 126,给出 94 个符号。 \n 和 \r 为 96 添加了两个,然后添加了消息结束标记,例如 \0 为 97。换句话说,这是早期 Engima 机器(带有固定反射器)的原始副本,用于加密 Windows 风格的文本数据会很好地匹配线索。

恩尼格玛机有一些已知的缺陷。如果你的教授非常友善,他会复制德国海军早期使用的弱系统。这是用一次性密钥加密每条消息,然后允许解密在使用标准密钥加密的消息开始时传输一次性密钥两次。通过传输两次,他们为密码分析提供了额外的上下文。

第二个众所周知的缺陷是角色永远不会映射到自身。因此,如果您有潜在的纯文本,则没有字符会匹配。

如果您知道转子和反射器的样子,就可以暴力破解 Enigma。不知道在这种情况下您有大约 10^15 种可能性可以探索。

The famous Enigma machine used 3 character symmetric alphabetic keys. 97 ASCII symbols? ASCII runs from 32 to 126 giving 94 symbols. The \n and \r add two more for 96 and then an end of message marker such as \0 for 97. To put it another way, a naive copy of the early Engima machines (with a fixed reflector) encrypting Windows style textual data would match the clues very well.

The enigma machine has some known flaws. If your professor was being exceptionally kind he will have replicated the weak system used by the German Navy early on. This was to encrypt every message with a one time key, but then to allow decryption to transmit the one time key twice at the start of the message encrypted using a standard key. By transmitting it twice they provided extra context to the cryptanalysis.

The second well known flaw was that a character never maps to itself. Thus if you have a potential plain text no character will match.

It is possible to brute force Enigma if you know what the rotors and reflector look like. Without knowing that you have around 10^15 possibilities to explore in this case.

逆蝶 2024-11-07 23:13:06

为什么不继续开始暴力破解每种最流行的对称密钥算法的所有 26**3 可能性:

以及您能找到的任何其他内容。

Why not go ahead and get started with brute forcing all of the 26**3 possibilities for each of the most popular symmetric key algorithms:

And any others you can find.

只是一片海 2024-11-07 23:13:06

由于该算法很简单并且是自制的,因此您可以尝试这些简单的算法:

  • 每隔 3 个字符与密码密钥重复
  • XOR 每第 2 个或第 1 个字符与密码密钥重复
  • XOR 异或和旋转/移位:密码密钥与密文和旋转/移位

由于您知道纯文本是常规文本,因此请在密文的前几个字符中查找模式,并查看它们是否可以与密码密钥组合以得出字母/数字的 ASCII 代码。

Since the algorithm is simple and homemade, you might try these naive algorithms:

  • repeated XOR with the cipher key every 3rd character
  • repeated XOR with the cipher key every 2nd or 1st character
  • XOR and rotate/shift: the cipher key is xor'ed with the ciphertext and rotated/shifted

Since you know the plain text it to be regular text, look for patterns in the first few characters of ciphertext and see if they can be combined with the cipher key to arrive at a ASCII code for a letter/number.

浅唱ヾ落雨殇 2024-11-07 23:13:06

现在,你说你已经做了统计分析。如果算法实际上很简单,则符号的频率将不会均匀分布。有些符号会更频繁地被发现。是这样吗?如果是这样,我会从那里挖掘。

我不妨证明我的教授
你的帮助有误

“我们的帮助”将是我们证明你的教授是错的。

Now, you said that you have done the statistical analysis. If algorithm is in fact naive, the frequencies of the symbols will not be uniformly distributed. Some symbols will be found more often. Is it the case? If so, I'd dig from there.

I might as well prove my professor
wrong with your help

With "our help" would be us proving your professor wrong.

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