Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SHA-1
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Cryptanalysis and validation== For a hash function for which ''L'' is the number of bits in the message digest, finding a message that corresponds to a given message digest can always be done using a brute force search in approximately 2<sup>''L''</sup> evaluations. This is called a [[preimage attack]] and may or may not be practical depending on ''L'' and the particular computing environment. However, a ''collision'', consisting of finding two different messages that produce the same message digest, requires on average only about {{nowrap|1.2 × 2<sup>''L''/2</sup>}} evaluations using a [[birthday attack]]. Thus the [[Security level|strength]] of a hash function is usually compared to a symmetric cipher of half the message digest length. SHA-1, which has a 160-bit message digest, was originally thought to have 80-bit strength. Some of the applications that use cryptographic hashes, like password storage, are only minimally affected by a collision attack. Constructing a password that works for a given account requires a [[preimage attack]], as well as access to the hash of the original password, which may or may not be trivial. Reversing password encryption (e.g. to obtain a password to try against a user's account elsewhere) is not made possible by the attacks. However, even a secure password hash can't prevent brute-force attacks on [[password strength|weak passwords]]. ''See'' [[Password cracking]]. In the case of document signing, an attacker could not simply fake a signature from an existing document: The attacker would have to produce a pair of documents, one innocuous and one damaging, and get the private key holder to sign the innocuous document. There are practical circumstances in which this is possible; until the end of 2008, it was possible to create forged [[Transport Layer Security|SSL]] certificates using an [[MD5]] collision.<ref>{{cite web|first1=Alexander |last1=Sotirov|first2=Marc |last2=Stevens|first3=Jacob |last3=Appelbaum|first4=Arjen |last4=Lenstra|first5=David |last5=Molnar|first6=Dag Arne |last6=Osvik|first7=Benne |last7=de Weger|url=http://www.win.tue.nl/hashclash/rogue-ca/|title=MD5 considered harmful today: Creating a rogue CA certificate|access-date=March 29, 2009|date=December 30, 2008}}</ref> Due to the block and iterative structure of the algorithms and the absence of additional final steps, all SHA functions (except SHA-3)<ref>{{Cite web|url = http://keccak.noekeon.org/|title = Strengths of Keccak – Design and security|access-date = 20 September 2015|website = The Keccak sponge function family|publisher = Keccak team|quote = Unlike SHA-1 and SHA-2, Keccak does not have the length-extension weakness, hence does not need the HMAC nested construction. Instead, MAC computation can be performed by simply prepending the message with the key.}}</ref> are vulnerable to [[Length extension attack|length-extension]] and partial-message collision attacks.<ref>{{Cite web |title=Schneier on Security: Cryptography Engineering |url=https://www.schneier.com/books/cryptography-engineering |access-date=2023-08-27 |website=www.schneier.com}}</ref> These attacks allow an attacker to forge a message signed only by a keyed hash – {{nowrap|SHA(''key'' {{!!}} ''message'')}}, but not {{nowrap|SHA(''message'' {{!!}} ''key'')}} – by extending the message and recalculating the hash without knowing the key. A simple improvement to prevent these attacks is to hash twice: {{nowrap|1=SHA<sub>d</sub>(''message'') = SHA(SHA(0<sup>''b''</sup> {{!!}} ''message''))}} (the length of 0<sup>''b''</sup>, zero block, is equal to the block size of the hash function). ===SHA-0=== At [[CRYPTO (conference)|CRYPTO]] 98, two French researchers, [[Florent Chabaud]] and [[Antoine Joux]], presented an attack on SHA-0: [[hash collision|collisions]] can be found with complexity 2<sup>61</sup>, fewer than the 2<sup>80</sup> for an ideal hash function of the same size.<ref name="sha0-chabaud">{{Cite book|chapter-url=https://link.springer.com/chapter/10.1007/BFb0055720|chapter=Differential collisions in SHA-0|first1=Florent|last1=Chabaud|first2=Antoine|last2=Joux|title=Advances in Cryptology – CRYPTO '98 |series=Lecture Notes in Computer Science |editor-first=Hugo|editor-last=Krawczyk|date=October 3, 1998|volume=1462 |publisher=Springer|pages=56–71|via=Springer Link|doi=10.1007/BFb0055720|isbn=978-3-540-64892-5 }}</ref> In 2004, [[Eli Biham|Biham]] and Chen found near-collisions for SHA-0 – two messages that hash to nearly the same value; in this case, 142 out of the 160 bits are equal. They also found full collisions of SHA-0 reduced to 62 out of its 80 rounds.<ref>{{Cite web|url=https://www.iacr.org/archive/crypto2004/31520290/biham-chen-sha0-proc-real-one.pdf|title=Near-Collisions of SHA-0|last1=Biham|first1=Eli|last2=Chen|first2=Rafi}}</ref> Subsequently, on 12 August 2004, a collision for the full SHA-0 algorithm was announced by Joux, Carribault, Lemuet, and Jalby. This was done by using a generalization of the Chabaud and Joux attack. Finding the collision had complexity 2<sup>51</sup> and took about 80,000 processor-hours on a [[supercomputer]] with 256 [[Itanium 2]] processors (equivalent to 13 days of full-time use of the computer). On 17 August 2004, at the Rump Session of CRYPTO 2004, preliminary results were announced by [[Xiaoyun Wang|Wang]], Feng, Lai, and Yu, about an attack on [[MD5]], SHA-0 and other hash functions. The complexity of their attack on SHA-0 is 2<sup>40</sup>, significantly better than the attack by Joux ''et al.''<ref>{{cite web|url=http://www.freedom-to-tinker.com/archives/000664.html|title=Report from Crypto 2004|url-status=dead|archive-url=https://web.archive.org/web/20040821031401/http://www.freedom-to-tinker.com/archives/000664.html|archive-date=2004-08-21|access-date=2004-08-23}}</ref><ref>{{Cite newsgroup|first=Francois |last=Grieu|newsgroup=sci.crypt|title=Re: Any advance news from the crypto rump session?|date=18 August 2004 |time=05:06:02 +0200|message-id=fgrieu-05A994.05060218082004@individual.net}}</ref> In February 2005, an attack by [[Xiaoyun Wang]], [[Yiqun Lisa Yin]], and Hongbo Yu was announced which could find collisions in SHA-0 in 2<sup>39</sup> operations.<ref name="autogenerated1">{{Cite web |title=SHA-1 Broken – Schneier on Security |url=https://www.schneier.com/blog/archives/2005/02/sha1_broken.html |website=www.schneier.com}}</ref><ref>[http://www.infosec.sdu.edu.cn/paper/sha0-crypto-author-new.pdf Efficient Collision Search Attacks on SHA-0] {{webarchive|url=https://web.archive.org/web/20050910132832/http://www.infosec.sdu.edu.cn/paper/sha0-crypto-author-new.pdf |date=2005-09-10 }}, [[Shandong University]]</ref> Another attack in 2008 applying the [[boomerang attack]] brought the complexity of finding collisions down to 2<sup>33.6</sup>, which was estimated to take 1 hour on an average PC from the year 2008.<ref>{{Cite conference|first1=Stéphane |volume=5086|pages=16–35|last1=Manuel|first2=Thomas |last2=Peyrin |date=2008-02-11 |url= https://link.springer.com/content/pdf/10.1007%2F978-3-540-71039-4_2.pdf |title=Collisions on SHA-0 in One Hour |conference=Fast Software Encryption 2008 |doi=10.1007/978-3-540-71039-4_2|series=Lecture Notes in Computer Science|isbn=978-3-540-71038-7|doi-access=free }}</ref> In light of the results for SHA-0, some experts{{who|date=September 2015}} suggested that plans for the use of SHA-1 in new [[cryptosystem]]s should be reconsidered. After the CRYPTO 2004 results were published, NIST announced that they planned to phase out the use of SHA-1 by 2010 in favor of the SHA-2 variants.<ref>{{Cite web |url=https://csrc.nist.gov/News/2004/NIST-Brief-Comments-on-Recent-Cryptanalytic-Attack |title= NIST Brief Comments on Recent Cryptanalytic Attacks on Secure Hashing Functions and the Continued Security Provided by SHA-1 |date= 23 August 2017 |access-date=2022-03-16 }}</ref> ===Attacks=== In early 2005, [[Vincent Rijmen]] and [[Elisabeth Oswald]] published an attack on a reduced version of SHA-1 – 53 out of 80 rounds – which finds collisions with a computational effort of fewer than 2<sup>80</sup> operations.<ref>{{cite journal |url=http://eprint.iacr.org/2005/010|title=Update on SHA-1 |journal=Cryptology ePrint Archive |year=2005|last1=Rijmen|first1=Vincent|last2=Oswald|first2=Elisabeth}}</ref> In February 2005, an attack by [[Xiaoyun Wang]], Yiqun Lisa Yin, and Hongbo Yu was announced.<ref name="autogenerated1" /> The attacks can find collisions in the full version of SHA-1, requiring fewer than 2<sup>69</sup> operations. (A [[brute-force search]] would require 2<sup>80</sup> operations.) The authors write: "In particular, our analysis is built upon the original differential attack on SHA-0, the near collision attack on SHA-0, the multiblock collision techniques, as well as the message modification techniques used in the collision search attack on MD5. Breaking SHA-1 would not be possible without these powerful analytical techniques."<ref>[http://theory.csail.mit.edu/~yiqun/shanote.pdf Collision Search Attacks on SHA1] {{Webarchive|url=https://web.archive.org/web/20050219180957/http://theory.csail.mit.edu/~yiqun/shanote.pdf |date=2005-02-19 }}, [[Massachusetts Institute of Technology]]</ref> The authors have presented a collision for 58-round SHA-1, found with 2<sup>33</sup> hash operations. The paper with the full attack description was published in August 2005 at the CRYPTO conference. In an interview, Yin states that, "Roughly, we exploit the following two weaknesses: One is that the file preprocessing step is not complicated enough; another is that certain math operations in the first 20 rounds have unexpected security problems."<ref>{{cite web|url=https://www.zdnet.com/article/fixing-a-hole-in-security/|title=Fixing a hole in security|first=Robert |last=Lemos|work=ZDNet}}</ref> On 17 August 2005, an improvement on the SHA-1 attack was announced on behalf of [[Xiaoyun Wang]], [[Andrew Yao]] and [[Frances Yao]] at the CRYPTO 2005 Rump Session, lowering the complexity required for finding a collision in SHA-1 to 2<sup>63</sup>.<ref name=":3">{{Cite web |title=New Cryptanalytic Results Against SHA-1 – Schneier on Security |url=https://www.schneier.com/blog/archives/2005/08/new_cryptanalyt.html |website=www.schneier.com}}</ref> On 18 December 2007 the details of this result were explained and verified by Martin Cochran.<ref>{{cite journal| url = http://eprint.iacr.org/2007/474| title = Notes on the Wang et al. 2<sup>63</sup> SHA-1 Differential Path| year = 2007| last1 = Cochran| first1 = Martin| journal = Cryptology ePrint Archive}}</ref> Christophe De Cannière and Christian Rechberger further improved the attack on SHA-1 in "Finding SHA-1 Characteristics: General Results and Applications,"<ref>{{Cite book |first1=Christophe |title=Advances in Cryptology – ASIACRYPT 2006 |volume=4284 |pages=1–20 |last1=De Cannière |first2=Christian |last2=Rechberger |date=2006-11-15 |chapter=Finding SHA-1 Characteristics: General Results and Applications |doi=10.1007/11935230_1 |series=Lecture Notes in Computer Science |isbn=978-3-540-49475-1 }}</ref> receiving the Best Paper Award at [[ASIACRYPT]] 2006. A two-block collision for 64-round SHA-1 was presented, found using unoptimized methods with 2<sup>35</sup> compression function evaluations. Since this attack requires the equivalent of about 2<sup>35</sup> evaluations, it is considered to be a significant theoretical break.<ref>{{cite web | url = http://www.iaik.tugraz.at/content/research/krypto/sha1/SHA1Collision_Description.php | title = IAIK Krypto Group — Description of SHA-1 Collision Search Project | access-date = 2009-06-30 | archive-url = https://web.archive.org/web/20130115071715/http://www.iaik.tugraz.at/content/research/krypto/sha1/SHA1Collision_Description.php | archive-date = 2013-01-15 | url-status = dead }}</ref> Their attack was extended further to 73 rounds (of 80) in 2010 by Grechnikov.<ref>{{cite web | url = http://eprint.iacr.org/2010/413 | title = Collisions for 72-step and 73-step SHA-1: Improvements in the Method of Characteristics | access-date = 2010-07-24 }}</ref> In order to find an actual collision in the full 80 rounds of the hash function, however, tremendous amounts of computer time are required. To that end, a collision search for SHA-1 using the volunteer computing platform [[BOINC]] began August 8, 2007, organized by the [[Graz University of Technology]]. The effort was abandoned May 12, 2009 due to lack of progress.<ref>{{cite web |url = http://boinc.iaik.tugraz.at/sha1_coll_search/ |title = SHA-1 Collision Search Graz |access-date = 2009-06-30 |url-status = dead |archive-url = https://web.archive.org/web/20090225115007/http://boinc.iaik.tugraz.at/sha1_coll_search/ |archive-date = 2009-02-25 }}</ref> At the Rump Session of CRYPTO 2006, Christian Rechberger and Christophe De Cannière claimed to have discovered a collision attack on SHA-1 that would allow an attacker to select at least parts of the message.<ref>{{cite web|url=http://www.heise-online.co.uk/security/SHA-1-hash-function-under-pressure--/news/77244|title=heise online – IT-News, Nachrichten und Hintergründe|work=heise online|date=27 August 2023 }}</ref><ref>{{Cite web|url=https://www.iacr.org/conferences/crypto2006/rumpsched.html|title=Crypto 2006 Rump Schedule|website=www.iacr.org}}</ref> In 2008, an attack methodology by Stéphane Manuel reported hash collisions with an estimated theoretical complexity of 2<sup>51</sup> to 2<sup>57</sup> operations.<ref>{{Cite web | first=Stéphane |last=Manuel | title=Classification and Generation of Disturbance Vectors for Collision Attacks against SHA-1 |website=Cryptology ePrint Archive |url=http://eprint.iacr.org/2008/469.pdf | access-date = 2011-05-19 }}</ref> However he later retracted that claim after finding that local collision paths were not actually independent, and finally quoting for the most efficient a collision vector that was already known before this work.<ref>{{Cite journal | first=Stéphane | last=Manuel | title=Classification and Generation of Disturbance Vectors for Collision Attacks against SHA-1 | journal=Designs, Codes and Cryptography | volume=59 | issue=1–3 | pages=247–263 | doi=10.1007/s10623-010-9458-9 | year=2011 | s2cid=47179704 }} ''the most efficient disturbance vector is Codeword2 first reported by Jutla and Patthak''</ref> Cameron McDonald, Philip Hawkes and Josef Pieprzyk presented a hash collision attack with claimed complexity 2<sup>52</sup> at the Rump Session of Eurocrypt 2009.<ref>{{cite web| url = http://eurocrypt2009rump.cr.yp.to/837a0a8086fa6ca714249409ddfae43d.pdf| title = SHA-1 collisions now 2^52 }}</ref> However, the accompanying paper, "Differential Path for SHA-1 with complexity [[Big O notation|''O'']](2<sup>52</sup>)" has been withdrawn due to the authors' discovery that their estimate was incorrect.<ref>{{cite journal |url=http://eprint.iacr.org/2009/259|title=Differential Path for SHA-1 with complexity O(<sup>252</sup>) |journal=Cryptology ePrint Archive |year=2009|last1=McDonald|first1=Cameron|last2=Hawkes|first2=Philip|last3=Pieprzyk|first3=Josef}} (withdrawn)</ref> One attack against SHA-1 was Marc Stevens<ref name="Cryptanalysis of MD5 & SHA-1">{{cite web| url = http://2012.sharcs.org/slides/stevens.pdf| title = Cryptanalysis of MD5 & SHA-1}}</ref> with an estimated cost of $2.77M (2012) to break a single hash value by renting CPU power from cloud servers.<ref>{{Cite web |title=When Will We See Collisions for SHA-1? – Schneier on Security |url=https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html |website=www.schneier.com}}</ref> Stevens developed this attack in a project called HashClash,<ref>{{Cite web |title=Google Code Archive – Long-term storage for Google Code Project Hosting. |url=https://code.google.com/archive/p/hashclash |website=code.google.com}}</ref> implementing a differential path attack. On 8 November 2010, he claimed he had a fully working near-collision attack against full SHA-1 working with an estimated complexity equivalent to 2<sup>57.5</sup> SHA-1 compressions. He estimated this attack could be extended to a full collision with a complexity around 2<sup>61</sup>. ====The SHAppening==== On 8 October 2015, Marc Stevens, Pierre Karpman, and Thomas Peyrin published a freestart collision attack on SHA-1's compression function that requires only 2<sup>57</sup> SHA-1 evaluations. This does not directly translate into a collision on the full SHA-1 hash function (where an attacker is ''not'' able to freely choose the initial internal state), but undermines the security claims for SHA-1. In particular, it was the first time that an attack on full SHA-1 had been ''demonstrated''; all earlier attacks were too expensive for their authors to carry them out. The authors named this significant breakthrough in the [[cryptanalysis]] of SHA-1 ''The SHAppening''.<ref name="shappening" /> The method was based on their earlier work, as well as the auxiliary paths (or boomerangs) speed-up technique from Joux and Peyrin, and using high performance/cost efficient GPU cards from [[Nvidia]]. The collision was found on a 16-node cluster with a total of 64 graphics cards. The authors estimated that a similar collision could be found by buying US$2,000 of GPU time on [[Amazon Elastic Compute Cloud|EC2]].<ref name="shappening" /> The authors estimated that the cost of renting enough of EC2 CPU/GPU time to generate a full collision for SHA-1 at the time of publication was between US$75K and $120K, and noted that was well within the budget of criminal organizations, not to mention national [[intelligence agency|intelligence agencies]]. As such, the authors recommended that SHA-1 be deprecated as quickly as possible.<ref name="shappening">{{cite web |url=https://sites.google.com/site/itstheshappening/ |title=The SHAppening: freestart collisions for SHA-1 |access-date=2015-10-09 |first1=Marc |last1=Stevens |first2=Pierre |last2=Karpman |first3=Thomas |last3=Peyrin}}</ref> ==== SHAttered – first public collision ==== On 23 February 2017, the [[Centrum Wiskunde & Informatica|CWI (Centrum Wiskunde & Informatica)]] and Google announced the ''SHAttered'' attack, in which they generated two different PDF files with the same SHA-1 hash in roughly 2<sup>63.1</sup> SHA-1 evaluations. This attack is about 100,000 times faster than brute forcing a SHA-1 collision with a [[birthday attack]], which was estimated to take 2<sup>80</sup> SHA-1 evaluations. The attack required "the equivalent processing power of 6,500 years of single-CPU computations and 110 years of single-GPU computations".<ref name="sha1-shattered"/> ==== Birthday-Near-Collision Attack – first practical chosen-prefix attack ==== On 24 April 2019 a paper by Gaëtan Leurent and Thomas Peyrin presented at Eurocrypt 2019 described an enhancement to the previously best [[Collision attack#Chosen-prefix collision attack|chosen-prefix attack]] in [[Merkle–Damgård construction|Merkle–Damgård]]–like digest functions based on [[One-way compression function#Davies–Meyer|Davies–Meyer]] block ciphers. With these improvements, this method is capable of finding chosen-prefix collisions in approximately 2<sup>68</sup> SHA-1 evaluations. This is approximately 1 billion times faster (and now usable for many targeted attacks, thanks to the possibility of choosing a prefix, for example malicious code or faked identities in signed certificates) than the previous attack's 2<sup>77.1</sup> evaluations (but without chosen prefix, which was impractical for most targeted attacks because the found collisions were almost random)<ref name="stevens-attacks"/> and is fast enough to be practical for resourceful attackers, requiring approximately $100,000 of cloud processing. This method is also capable of finding chosen-prefix collisions in the [[MD5]] function, but at a complexity of 2<sup>46.3</sup> does not surpass the prior best available method at a theoretical level (2<sup>39</sup>), though potentially at a practical level (≤2<sup>49</sup>).<ref name="leurent-peyrin-sha1">{{cite conference |chapter-url=https://hal.inria.fr/hal-02424900/file/SHA1_EC19.pdf |last1=Leurent |first1=Gaëtan |last2=Peyrin |first2=Thomas |title=Advances in Cryptology – EUROCRYPT 2019 |chapter=From Collisions to Chosen-Prefix Collisions Application to Full SHA-1 | conference= 38th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Darmstadt, Germany, May 19–23, 2019 |date=2019 |url=https://eprint.iacr.org/2019/459.pdf | publisher= Springer |series=Lecture Notes in Computer Science |volume=11478 |pages=527–555 |doi=10.1007/978-3-030-17659-4_18 |isbn=978-3-030-17658-7 |s2cid=153311244 | editor1= Yuval Ishai| editor2= Vincent Rijmen}}</ref> This attack has a memory requirement of 500+ GB. On 5 January 2020 the authors published an improved attack called "shambles".<ref name="leurent-peyrin-sha1-shambles"/> In this paper they demonstrate a chosen-prefix collision attack with a complexity of 2<sup>63.4</sup>, that at the time of publication would cost US$45K per generated collision. ===Official validation=== {{Main|Cryptographic Module Validation Program}} Implementations of all FIPS-approved security functions can be officially validated through the [[Cryptographic Module Validation Program|CMVP program]], jointly run by the [[National Institute of Standards and Technology]] (NIST) and the [[Communications Security Establishment]] (CSE). For informal verification, a package to generate a high number of test vectors is made available for download on the NIST site; the resulting verification, however, does not replace the formal CMVP validation, which is required by law for certain applications. {{As of|2013|alt=As of December 2013}}, there are over 2000 validated implementations of SHA-1, with 14 of them capable of handling messages with a length in bits not a multiple of eight (see [http://csrc.nist.gov/groups/STM/cavp/documents/shs/shaval.htm SHS Validation List] {{Webarchive|url=https://web.archive.org/web/20110823092514/http://csrc.nist.gov/groups/STM/cavp/documents/shs/shaval.htm |date=2011-08-23 }}).
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
SHA-1
(section)
Add topic