Reports of SHA-1's demise are considerably exaggerated
metzdowd.com
metzdowd.com
It's a bit hard to take the author seriously when he complains about "headless chickens" "considerably exaggerat[ing]" then goes on to say that you need "a nation-state's worth of resources" to find collisions. If anything this shattered proof of concept showed that it was actually a lot easier than that, giving an estimate of around 110k$ IIRC.
I'm also sure that SHA-1 remains pervasive in many codebases, although as long as pre-image are impractical it might be hard to exploit those vulnerabilities.
I've done a lot of security reviews of backup solutions over the years and nearly universally they use SHA1 for de-duplication. Security professionals have been providing warnings about this practice, but when you are dealing with a cloud backup solution as an example, speed and low compute requirements are a must and it's hard to win the argument when someone tosses "theoretical" onto the table. Well, we are now past "theoretical" and that's what matters.
I just tried out the SHA1 collider: https://alf.nu/SHA1 and created two PDFs containing entirely different bits of text in JPGs. It took seconds and indeed the output of the files were SHA1 identical. This is no longer nation-state level stuff and computing colliding documents to upload to cloud backup providers who de-dupe across the file system and not just restricted within the boundaries of each account could result in the ability to wipe out and change other people's data. At a minimum that could be an annoyance. At worst, it could result in the intentional change of someone's content to cause significant financial or physical harm.
if you want a proof, submit a different image: the hashes will be identical, but different from your first attempt.
http://i.imgur.com/iJZe21Z.png Rel: https://news.ycombinator.com/item?id=13725093
SVN is probably not the only piece of software where you can create a mess solely with the already released collision. It's more like a DOS, and less like actually injecting a malicious payload, but potentially still destructive.
Edit: Perhaps I'm missing the context of "considerably exaggerated"? Are there some examples of people saying the sky is falling?
Remember, it's also in the FIPS SHA-2 standard and faster on 64bit CPUs then SHA-256. It's only 64 bytes long, surly that's not too much to handle.
Edit: Goggle also suggests SHA-256, so perhaps Peter was simply seconding the recommendation. I suggest SHA-512 is the better recommendation.
First, it carries the information of which hash function was used to produce the digest "in-band", so that this information does not need to be obtained out-of-band, or from a different input, or inferred from context.
Second, because it carries this information inside one data item, it essentially domain-segregates the information space of the digest by hash function, which ensures that two digests generated by two different hash functions never collide into the same value. While this property seems very useful, in truth this can only happen if the two different hash functions in question generate digests of the same length, and because the hash functions are different, you can't mount a collision attack, so you must work backwards from one of the outputs to try to break the other [1].
This then shows that the hard part about "migrating hashes" isn't usually the data structures, but rather the policies and practices on how you affect access or treatment of data items identified by or checksummed by the now-insecure hash; whether you have enough data and knowledge contained within the closed system that seamless migration is possible internally; how you communicate changes in content-addressing to users such that they can evaluate the trust and risks (similar to "seamlessly" upgrading HTTP to HTTPS), etc.
[1] I'm not a crypto expert so I'll avoid commenting in precise, technical terms [2] of which exact attack this would entail.
IMHO you should not "future-proof" password hashes, collision attacks for passwords are more difficult to achieve than many people realize. What you should as a developer do, is stop using the hash and only migrate systems that actually required in a case by case basis.
There are good reasons to use SHA-3, but one should not consider using SHA-3 on the grounds that it is known to be a better hashing algorithm then SHA-2. It is not. In fact, SHA-2 has a much greater level of confidence due to it's age.
I've implemented both SHA-256 and SHA-512, and seen the more modern Blake2 in detail: Blake2 is not more complex, it's fast, and for now it's solid. I expect it to stay secure for a long time, given its Chacha heritage.
SO BIG. For git, most people don't realize in most cases if the repo isn't giant you can use just 96a as a shortcut. I imagine people would be turned off by the sheer size.
But I think SHA-512 is resistant to near-collisions (sorry, I don't have a citation), and besides, one would probably best compare hashes using a script one understands.
[0] http://link.springer.com/content/pdf/10.1007%2F978-3-540-286...
All good hash functions have an even distribution, and are therefore resistant to near-collisions. Hash tables for example require this property to work properly.
s2rn74v2dlho2gmu7xozvxbhmvlmpcoffu7f7cqxefydurq5igvu3xmvmmdv5cw5uy4cvde5kk7hrlqh53dx3t52lcly5kdsscuqfdy is at least not case-sensitive.
And so much for Google's 90 day disclosure period.
In order to perform that kind of attack, there would need to be a second pre-image attack, which does not exist right now.
Even md5 still has second pre-image resistance with a search space only slightly below the entire output space.[1]
1. http://crypto.stackexchange.com/questions/13303/is-md5-secon...
It's safer to "join the headless chicken" route, consider SHA-1 officially broken, and start thinking of alternatives.
Why is the difference between collision and preimage so difficult for people to understand...? I'm genuinely puzzled.
By the way, nation-states won't use GPUs. They'll use ASIC. They tend to be 4-6 orders of magnitude more energy efficient than GPU for this kind of things (at least they are for Bitcoin mining). I just hope nobody succeeded in the business of selling MD5 colliders —it would mean the same could work with SHA-1.
Depending on the demands of the algorithm, an ASIC could outmatch an x86 farm —possibly by even more orders of magnitude than they do GPUs.
Possible hurdles for the ASIC are memory hardness, (memory costs the same no matter the architecture), branching, and complex operations such as multiplications. They could destroy any advantage the ASIC have.
I was under the impression the use of SHA1 was only for hashing and not for a security signature. And what would be the benefit of intentionally causing a collision? Would it cause some sort of DoS like someone else here mentioned?
This is mostly correct. The commands git commit -S and git tag -s both sign commits and tags, respectively, using GPG. The signature covers only the commit object: the tree's SHA1, the commit/author data, and the commit message, not the entirety of the data.
git's objects' SHA1 is computed, for "file" objects, as "blob " + ascii decimal size of blob + nul + data in the blob. The two PDFs in Shattered are the same size, and thus, have the same git object header. However, naïvely prefixing the two shattered PDFs with their git header results in different hashes; I presume this is b/c the internal state of SHA1 differs from what the constructed data that causes the collision expects. You can see this yourself:
% ls -l shatter*.pdf
-rw-r--r-- 1 - - 422435 Feb 24 19:27 shattered-1.pdf
-rw-r--r-- 1 - - 422435 Feb 24 19:27 shattered-2.pdf
% { printf 'blob 422435\0'; cat shattered-1.pdf; } | gsha1sum -
ba9aaa145ccd24ef760cf31c74d8f7ca1a2e47b0 -
% { printf 'blob 422435\0'; cat shattered-2.pdf; } | gsha1sum -
b621eeccd5c7edac9b7dcba35a8d5afd075e24f2 -
If you commit the two PDFs to git, those are the hashes they will have. They are different. Now, if you take the header into account when computing the collisions, you can create a collision. The paper seems to say that the attack takes a known (and controllable) prefix P, and finds two sets of two 512-bit (64 byte) blocks (different for the two files), M_1^(1) and M_2^(1) for the first file, and M_1^(2) and M_2^(2) for the second file, that cause the internal state of the hash to collide; after than, any (also controllable) suffix S (but the same for both files) can be appended.This is why the diff[1] is as long as it is: each side of the diff is 128 bytes; the two M blocks.
Thus, if you computed a prefix P that started with the git blob header, then some data for your file, and ran this attack, you should be able to create two files that, when committed to git, collide. The two pieces of data in the header don't cause any trouble: the paper's method allows you to control the output size, mostly, so we can mostly choose any size we want; the type is always "blob" and is thus effectively constant.
Now, from what I can gather from the paper, there doesn't seem to be real control over the portion that differs; that's really what we need to take advantage of this beyond just creating collisions. This is a collision, but it's not what's called a chosen-prefix collision. A chosen-prefix collision lets me choose two different prefixes (which gives the attacker much more control over the differences in content, thus it becomes much easier to craft a "good" and a "bad" version); this attack requires both files to have the same prefix.
Now, here is the worst way I can think of as to how I could get a colliding object to you:
Imagine that I can convince someone you trust to sign a commit; this commit contains, either directly or indirectly via an ancestor commit, an object whose hash we will collide.
Now, if I can later get you to download that commit and all its parents, except I substitute one object's data for another's. The signature is still good: I've not changed the commit object in any way; it references objects by SHA1 hash, and the hash hasn't changed, "only" the data.
Here's another scenario, and you don't need signatures in this scheme; if I push a commit to master w/ the "good" version of the object, but before you pull it, I push to you a branch that contains the bad object, then git writes the bad object to your objects folder, under the colliding hash. You now pull master, but git doesn't pull the "good" version of the object, b/c it already has an object with that hash. Your master is now different; I've effectively poisoned your repo with the bad object.
Now, whether you can pull off this stunt or not, IDK. My point is that a) git's signatures don't cover the entirety of the repository, only a now-very-weak cryptographic hash, and b) git is (I believe) subject to object collision from this. But presently I'm not seeing how it can be maliciously taken advantage of. But then, people are really clever.
At the same time, you could remove the hash prefixes (blobs are prefixed with "blob") so that the hashes would be be identical to those generated by other software.
I don't think there is anything preventing from doing such an exploit in 1 month, or even less. With the various CaaS providers the total cost even remains the same!
IOW, for a criminal organization (or just a single criminal) with a huge botnet the direct cost might be closer to $0. Of course there's opportunity cost--botnets are often rented like a cloud service--but that's the case for everything.
If people spent half the effort they spend bikeshedding password authentication and instead work to support hardware security tokens--both client- end server-side (i.e. with an HSM hashing client passwords using a secret key), we'd all be in a better place.
I remember when I first heard of git I wondered why it didn't use a member of the SHA-2 family (which had been out for several years by then). Even in 2005 I think that it was fast enough.
Assuming that the massive numbers of cores necessary don't cause any extra difficulties (seems like a stretch), we get 68,328,000,000 CPU cores to do the CPU portion in 30 minutes, and 115,632,000 GPUs to do the GPU part in 30 minutes.
Assuming 1U servers each with 2 64-core CPUs, that's at least 533,812,500 physical servers, which is at least 12,709,822 42U server racks. That would take up ~85,000,000 sqft, or 3.04 square miles.
That's just for the CPUs. You could probably fit 1GPU per server, but I assume this isn't the typical config for cloud GPUs. In any case, it could probably be done in, let's call it 4 square miles of server floor space.
Note: these are pretty conservative estimates at every step. It doesn't take into account any practicalities, like having server aisles wide enough for golf carts (because, really, 3 miles on a side is a bit of a hike on foot). Or how power is delivered. Or how to communicate all of that parallel work. Or the colossal amount of maintenance staff that would be required. Or keeping that many servers cool enough to work continuously... etc.
After you figure all that out, now you can get to the small task of figuring out how to continuously deliver 120-ish[1] gigawatts of power to those servers.
[1] 90 Watts per 64-core CPU (2 of those per server), and 180 Watts per GPU (lifted from fryguy's sibling comment). Turns out the CPU part is a lot more expensive in just about every way than the GPU part. Accordingly, you would probably adjust this so that you spend 55 minutes on the CPU and 5 on the GPU portion, or something like that.
[Edit: added the footnote, and refined my estimate of the power requirements, also clarity edits]
The numbers they give for the GPU part are more confusing, and despite the time difference, they say it was the more expensive phase of the attack. However, it appears to involve considerably less physical hardware.
Still pretty impractical for what's probably limited value, but not out of reach.
So oops, I guess.
Looking at it from the other direction, they claim 110 GPU-years. A GeForce GTX 1080 is claimed to be 180 W. That's 175'000 kWh. If you assume that dedicated hardware ASICs are 100x more power efficient than the card I claimed, that has at least a similar order of magnitude. To do it in an hour would take a million graphics cards, and ~200 MW.
no it uses sha256
"Reports of SHA-1's demise are considerably exaggerated"
I assume either a bot or a tired moderator was involved.
And the title given to the specific email by its author is definitely more representative of its comments than the title of the first email in the chain.
As far as click-bait, I rate both of them equally click-baity.
There was little reason to change the submission title.