我将如何逆向工程加密算法? [英] How would I reverse engineer a cryptographic algorithm?

查看:339
本文介绍了我将如何逆向工程加密算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个以这种方式加密文本的应用程序:


  1. 获取输入文本

  2. 反转文本


  3. 转换为十六进制


  4. 使用密钥进行XOR


  5. Base64编码


现在,我自己没有做很多的加密/编码,所以我的问题可能听起来很愚蠢,但是说我得到一个有上述算法内容的文件,我不知道这个算法。如何开始打破文本,是否有任何指导方针,原则,遵循的规则?



我的问题与这5个步骤没有关系,那就是纯粹的例如。



作为一个不同的例子,请看文本:A751CD9E1F99。如何开始调查这可能意味着什么?

解决方案

为了打破密码,密码分析使用所有可以收集的信息。攻击分为几类,具体取决于所知。一些主要攻击,从最难到最简单的是




  • 仅限密文:这是最难的攻击。分析人员试图收集尽可能多的加密消息,并分析它们以寻找符号频率中的模式或偏差。然而,使用良好的现代密码,没有模式。这是不可行的一个好的密码,正确使用。

  • 已知明文:明文对应一些密文是从新密文恢复未知明文的一大步。这是逆向工程真正开始的地方,因为他可以根据已知的输入和输出来测试关于算法的假设。在第二次世界大战中,密码分析工作人员努力建立广泛的婴儿床列表,可能会出现在敌人的信息中,以利用已知的明文攻击。例如,特定日子的天气情况或战斗地名等可能会在加密的消息中向总部报告。

  • 选择明文:更好的是当密码分析可以欺骗他的敌人加密由密码分析器创建的消息。在战争中,有时假冒的信息会泄漏给敌人,希望它能被加密,并帮助密码分析工具打破代码。

  • 自适应选择明文:这是一种迭代的方法已知明文。密码分析器可以重复地使用系统加密的他的纯文本,并查看结果来调整他的下一次尝试。



破坏代码的可能方法是通过系统的缺陷。例如,可能使用差的密钥管理,允许密钥被盗或被猜测。在其他情况下,可能会使用侧信道攻击。例如,通过仔细测量某些加密操作所需的时间,攻击可能能够猜测密钥的某些位或字节为零,从而导致通过某种算法的快速路径。



在tinfoil hat附近的频谱结束的方法是拦截计算设备的无线电发射。这允许远程代理看显示器上显示的内容。甚至有特别设计的字体可以尝试破坏这种窃听。


I wrote an application that encrypts text in this way:

  1. Get the input text

  2. Reverse the text

  3. Convert to hexadecimal

  4. XOR with a key

  5. Base64 encode

Now, I didn't do a lot of encryption/encoding myself, so my question might sound stupid, but, say I get a file which has a content from the above algorithm and I didn't know about this algorithm. How would one start "breaking" the text, are there any guidelines, principals, rules to follow?

My question is not tied to those 5 steps, that was a pure example.

As a different example, take the text: A751CD9E1F99. How would I start investigating what this might mean?

解决方案

In order to break a cipher, cryptanalysts use all the information they can gather. Attacks fall into a number of categories, depending on what is known. Some of the main attacks, from hardest to easiest, are

  • ciphertext-only: this is the hardest attack. The analyst tries to collect as many encrypted messages as he can, and analyzes them to look for patterns or biases in the frequency of symbols. However, with good, modern ciphers, there are no patterns. This is infeasible with a good cipher, properly used.
  • known-plaintext: having the plaintext corresponding some ciphertext is a big step toward recovering unknown plaintext from new ciphertexts. This is where "reverse-engineering" really begins, because he can test his hypotheses about the algorithm against known input and output. In World War II, cryptanalysts worked hard to build extensive lists of "cribs"—words that were likely to appear in the enemy's messages—to exploit known-plaintext attacks. For example, weather conditions on a particular day, or place names of battles, etc. were likely to be reported to headquarters in encrypted messages.
  • chosen-plaintext: even better is when the cryptanalyst can trick his enemy into encrypting a message created by the cryptanalyst. In wartime, sometimes fake information would be leaked to the enemy, hoping that it would be encrypted and help the cryptanalyst break the code.
  • adaptive chosen-plaintext: this is sort of an iterative approach to known plaintext. The cryptanalyst can repeatedly have his chosen-plaintext encrypted by the system, and looks at the results to adjust his next attempt.

Nowadays, likely ways to break a code are through flaws in the system. For example, poor key management might be used, allowing the key to be stolen or guessed. In other cases, a "side-channel" attack might be used. For example, by carefully measuring the time it takes for certain cryptographic operations, an attack might be able to guess that certain bits or bytes of a key are zero, causing a fast path through some algorithm.

Up near the "tinfoil hat" end of the spectrum are methods to intercept radio emissions from computing equipment. This allows a remote agent to "see" what is displayed on a monitor. There are even specially designed fonts to try and disrupt this sort of eavesdropping.

这篇关于我将如何逆向工程加密算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆