Homework 5 Knowledge Expansion of Hash Function Security + 2016012102 + Cao Ying

 

 

Homework 5:

This assignment is an extension of knowledge about hash function security.

Assignment topic: The application of hash function and its security.

Content requirements:

(1) Give the specific application of the hash function

(2) Combined with the birthday attack, and Professor Wang Xiaoyun's MD5 security in 2004/2005 and the security of Google's SHA-1 in 2017, explain the security of hash functions and the current development of secure hash functions. The answer to question 2 can be combined with the first link given below. Link 1: https://www.win.tue.nl/hashclash

(3) Combine the selection prefix collision in the MD5 algorithm and the md5 message digest value of the two executable files helloworld.exe and goodbyworld.exe in the second link and the execution results of the two files to illustrate the md5 algorithm to verify the software integrity problems that may arise. Link 2: http://www.win.tue.nl/hashclash/SoftIntCodeSign/

 


 

( 1) The specific application of the hash function

   There are mainly message authentication, digital signatures and other applications (generating single-password files, intrusion detection and virus detection, building random functions or doing pseudo-random number generators, etc.).

   Message authentication is a mechanism or service used to verify the integrity of a message. Message authentication ensures that the data received is indeed the same as when it was sent (i.e. no modification, insertion, deletion or replay), and also requires a message authentication mechanism to ensure that the sender's claimed identity is true and valid. The Hash function is called message digest when it is used to provide message authentication. The same Hash calculation is performed on the message, and the result is compared with the received Hash value. If it does not match, the message or Hash value has been tampered with.

   A digital signature is the hash value of the encrypted message using the user's private key, and anyone else who knows the user's public key can verify the integrity of the message through a digital signature.

   There are three other applications. The Hash function is used to generate a single password file, and the operating system stores the hash value of the password. When the user enters a password, the operating system compares the hash value of the input password with the hash value stored in the password file. Hash function can be used for intrusion detection and virus detection. The Hash value H(F) of each file is stored in the security system, and H(F) is recalculated to determine whether each file has been modified. The intruder can only change it. F can not change H(F); Hash function can also be used to construct random function or used as pseudo-random number generator, and the random function based on Hash function can be generated by the key in symmetric cipher.

 

(2) The security of hash functions and the current development of secure hash functions

①Security of hash function

   There are two ways to attack secure hash functions: cryptanalysis and brute force attacks. The strength of a hash function against brute force attacks depends entirely on the length of the hash code generated by the algorithm. Van Oorschot and Wiener have proposed that spending $10 million involving a machine designed to search for collisions with the MD5 algorithm can find a collision in an average of 24 days.

   Cryptanalysis is the study of the deciphering problem of cryptosystems, that is, the decipherer attempts to recover the plaintext message or key from the intercepted ciphertext without knowing the encryption key. Cryptanalysis methods actually refer to password attack methods. According to the different analysis data that cryptanalysts may obtain, cryptanalysis methods can be divided into four categories:

1. Ciphertext-only analysis (attack), the cryptanalyst obtains one or more ciphertexts encrypted with the same key;

2. Known plaintext analysis (attack), in addition to the ciphertext to be deciphered, the cryptanalyst also obtains some ciphertext pairs encrypted with the same key;

3. Choose plaintext analysis (attack), the cryptanalyst can obtain the ciphertext corresponding to any plaintext he chooses (excluding the plaintext he wants to recover), these ciphertext pairs and the ciphertext to be deciphered are encrypted with the same key of;

4. Select ciphertext analysis (attack), the cryptanalyst can obtain the plaintext corresponding to any ciphertext he chooses (except the ciphertext to be deciphered), these ciphertext and plaintext and the ciphertext to be deciphered are the same decryption cipher. It is mainly used in public key cryptosystems.

   暴力攻击法是准确的是暴力破解,原理是穷举法。穷举法的基本思想是根据题目的部分条件确定答案的大致范围,并在此范围内对所有可能的情况逐一验证,直到全部情况验证完毕。若某个情况验证符合题目的全部条件,则为本问题的一个解;若全部情况验证后都不符合题目的全部条件,则本题无解。穷举法也称为枚举法。

   生日攻击——生日攻击是利用概率论中的生日问题,找到冲突的Hash值,伪造报文,使身份验证算法失效。过程是A要对一个合同文件进行签名,然后把合同文件和签名一起发送给接收者。签名的方法:计算文件的Hash值(m位),然后使用A的私钥对这个Hash值进行加密。接收者使用A的公钥进行解密,然后比较Hash值,这样就能确认: 接收到的合同文件是A发送的,并且合同文件未被修改。攻击者B想要伪造一份假合同文件,然后发送给接收者,并使接收者相信: 接收到的合同文件是A发送的,并且合同文件未被修改。 

   防范方法:使用安全的Hash算法,安全的Hash算法生成的Hash值有足够多的位数,攻击者在寻找两个具有相同Hash值的文件时就会非常困难;在为文件签名之前,先向文件添加一个随机值,然后计算Hash值,再将文件、签名和随机值一起发送给接收者,攻击者很难找出具有特定Hash值的伪造文件。在为文件签名之前,对消息或文件做少许改动,攻击者很难找出具有特定Hash值的伪造文件。

②目前安全散列函数的发展

   单向散列函数或者安全散列函数之所以重要,不仅在于消息认证(消息摘要,数据指纹),还有数字签名(加强版的消息认证)和验证数据的完整性。常见的单向散列函数(安全散列函数)有MD5和SHA。

   2004年8月中国密码学家王小云教授等首次公布了提出一种寻找MD5碰撞的新方法。目前利用该方法用普通微机几分钟内即可找到MD5的碰撞。MD5已经呗彻底攻破。王晓云教授和她的同事的思想是hashclash研究的基础,Marc Stevens的TU/E硕士学位项目就是在此基础上扩展了MD5和SHA-1哈希函数的碰撞生成的理论和实验结果。
   在Marc Stevens硕士学位论文方面,贾景晖的MSC项目非常成功。贾景晖在2007年6月顺利通过他的硕士学位论文,并取得最高的成绩10分。之后贾景晖在信息安全领域获得了JoopBouz奖的提名。2008年7月2日,MARC收到了“TU/E AFSTUDEPRIJS 2008”,即TU/E最佳硕士论文奖,是2007完成的TU/E硕士课程之一的最佳最终项目。
   在快速碰撞发现方面,HASCLASH的第一个可交付性是MD5的快速碰撞生成算法。该方法发现没有任何特殊性质的碰撞(除了可以从王氏方法预期的)。
在选择前缀冲突方面,HASCLASH的第二个可交付性是为MD5构建选择的前缀冲突的方法。这意味着,对于任何有针对性的对不同消息M1和M2,可以有效地构建附属物B1和B2,使得MD5(M1*B1)等于MD5(M2×B2)。换言之,可以导致任何一对不同的IHVs的MD5碰撞。对于贾景晖的MSC论文,他成功地产生了一个选择前缀碰撞的例子。这是用相应的应用程序来完成的(常用软件下载:Marc Stevens现在维护了一个代码页——HASCLASH-框架MD5差分路径构造和选择的前缀冲突;可用的(旧的)软件:一个快速的“MD5碰撞生成器”,1.0.0.1版本;最新的应用程序是创建一个流氓CA证书。),作为一个应用程序,我们有一种方法,为不同的身份构造一对冲突的X.509证书。
   但是,在贾景晖的论文完成后发现了更壮观的结果。
   在分布式计算方面,HASCLASH需要广泛的计算工作,可以很容易地并行化。我们使用BONC操作了一个网格。HasCulasBoIP服务器现在离线了(实际上它不再存在于物理上),因为它不再需要了。贾景晖毕业后完成的HASCLASH部分主要是在一个(索尼)PlayStation 3(S)集群上完成的。
   在其他应用方面,自从贾景晖完成论文以来,他做了更多的工作,尤其是九月和2007年10月在EPFL访问Arjen Lenstra的时候。结果是由多个12个PDF文件的碰撞和一对冲突的可执行文件组成的NotruADAMUS攻击。

 

(3)说明MD5算法来验证软件完整性时可能出现的问题

①MD5算法中的选择前缀碰撞

   选择前缀冲突——当将碰撞合并到一对文件中时,王教授创建碰撞的原始方法要求文件完全相等,除了包含冲突的相对较小的随机看起来的字节块之外。去年,在王教授的帮助下,我们展示了她如何改进MD5的攻击以提供选择的前缀冲突。我们选择的前缀冲突只要求在碰撞后文件应该完全相等。在碰撞之前,要找到碰撞的两个文件可以是任何东西:我们所选择的前缀碰撞查找方法总是会产生一个冲突,该冲突可以被合并到两个文件中,而不管碰撞之前存在什么数据。

②helloworld.exe和goodbyworld.exe两个可执行文件的MD5消息摘要值和两个文件的执行结果

   这里是Win32可执行的HeloRoLL.EXE。

   可执行文件hReloRL.EXE的MD5哈希值为E5F0FC6D3586C4DD15970D5BE7B0B9C7。

 

#include "stdafx.h"

int main(int argc, char* argv[])

{

    printf("Hello World ;-)\n");

    return 0;

}

   一个坏的执行我们写的程序goodbyeworld.cpp,与下面的C++源代码:

 

#include "stdafx.h"

int main(int argc, char* argv[])

{

    while(true)

        printf("Goodbye World :-(\n");

    return 0;

}

 

   它并不是真正有害的,只是令人讨厌。这里是Win32可执行文件GooByWork.EXE。可执行文件GoDyEWorWork.EXE的MD5哈希值为6503BDF2ADCE98B500 219640E6CF99 CA。

③可能出现的问题

1.使可执行文件冲突

   为了仔细构建两个832字节的块,并将它们附加到两个文件的末尾,我们将我们所选择的前缀冲突查找方法应用到文件HeloRoL.D.EXE和GooBeEdWork.EXE。这是这2次832字节已经被构建,使得结果文件被重命名为HeloReld碰撞。.EXE和GooByeWorksCopuln.EXE,具有完全相同的MD5哈希值。

2.冲突的可执行文件

   下面是两个冲突的文件,Win32可执行的HeloReldLogix.EXE和Win32可执行文件GooByeWorksCopulin.EXE。

HeloLogLD碰撞.EXE具有与HeloRoL.D.EXE完全相同的良好功能,而GooByeWorksEngulix.EXE具有与GooByWorx.EXE完全相同的恼人功能。虽然HeloReld碰撞.EXE和GooByEnWorksCopuln.EXE是不同的文件,包含具有不同功能的程序,但它们都具有MD5哈希值18FCC4334 F44 FD60718E7DACD82DDDF。

3.脆弱性

   由两个不同文件共享的散列值是碰撞构造过程的结果。我们不能针对给定的哈希值,并生成一个(有意义的)输入位串哈希到给定的值。在密码学术语中:我们的攻击是对碰撞阻力的攻击,而不是对预像或第二像前阻力的攻击。这意味着这两个冲突文件必须在攻击者在下载站点上发布或由代码签名方案签署之前,由攻击者专门准备。以这种方式未准备的已知散列的现有文件不易受攻击。

   然而,我们可以很容易地在一些额外的字节上进行蛮力搜索,例如让散列值的前三个和最后三个字节与给定的目标匹配。这可能会引入额外的漏洞,因为许多人(包括至少两个人)通常只检查哈希值时的第一个和最后三个字节。

   为了在软件完整性保护或代码签名方案上滥用选择的前缀冲突,攻击者应该能够在文件被哈希和/或签名之前对其进行操作。这可能意味着攻击者需要内幕访问操作可信软件完整性保护或代码签名过程的当事人。这样的攻击者可能最有可能造成更大的危害,而不需要选择前缀冲突,以获得官方的恶意软件上的数字签名。另一方面,存在依赖方的观点,即用户下载散列或签名的代码,需要保证该软件是可信的。

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613091&siteId=291194637