SHA-256 Certificates Are Coming
imperialviolet.org
imperialviolet.org
We found out the impact of this the hard way -- not only with Windows older than XP Service Pack 3, but also with embedded systems and devices built with OpenSSL older than 0.9.8o.
I'm asking because I recently bought a Comodo PositiveSSL certificate, and it was still signed with SHA-1. The intermediate certificate was also signed with SHA-1 (the same one that they've been using for quite a while already). I guess they reserve SHA-256 to more expensive products for now?
RHEL5's openssl 0.9.8e and Debian "Lenny" 5.0's openssl 0.9.8g both work fine with the SHA-256 signed cert. Although they may have backports applied.
It wasn't enabled by default until 0.9.8o. In earlier versions, if you wanted to use SHA-256 with SSL/TLS, you needed to call OpenSSL_add_all_algorithms() or specifically enable SHA-256. Not all software does this. I would guess that embedded systems shy away from it because it does add some overhead.
Use of the EVP lookup functions is dependent upon calling OpenSSL_add_all_algorithms() or populating the tables by other means. What (if any) algorithms are available without doing so is not defined anywhere in the API. There is no guarantee that SHA-1 or MD5 would be available either.
Edit: If you know of programs linked against early openssl 0.9.8 that are having problems you should file bugs, because they are reliant upon undefined behavior in the OpenSSL API. This is true even when linked against OpenSSL 1.0.1.
Edit 2: Not that this makes the problem any less real, but the problem is the broken applications, not the version of OpenSSL they linked to. Being version 0.9.8o is not necessary for SHA-256 certificate support for programs correctly using the OpenSSL API.
I think a lot of times people on HN and related sites are a little callous to the needs of users stuck on old platforms. But in this case even I'm like "screw those people". Is there any common legitimate reason to be on XP but not be able to go to SP3?
I'd be interested to see if this is one of the big divides here.
Aside: burn karma burn, if that's the community I don't want to be a part of it
s/will// ; if you're running XP at all, let alone XP without the latest service pack, you have problems, and this is hardly the most prominent of them.
The truth is that Linux is actually mature enough now that is is facing many of the same issues. The inevitable competing interests of a stable base to support on one hand and the need for the latest features or hardware support on the other are very real even for Linux.
Need to run proprietary software on Linux? The supported distro is often still RHEL5. If you are lucky its RHEL6, but that often does not include RHEL6.5. The same goes for hardware driver support. I use something regularly that only supports Debian, but the version it supports was already known as Old-Stable at the time of release and its now Old-Old-Stable. (And its only through luck that its not Debian Old-Old-Old-Stable like it was originally going to be) Not every commercial linux vendor falls into this habit, but enough do that its a very real problem. Often you have conflicting requirements from different vendors, or even for different applications from a single vendor.
Think this is limited to proprietary software... Which version of python are you running? If you answer python3, do you also have python2 installed as well? Thats what I thought :) (Inevitably the 5 people who have succesfully and fully migrated to python3 will reply just to prove me wrong, but those 5 are the rare exceptions.)
I thought I could get away with a few python2.7isms, but apparently not :-(
Python 2.4.3 (#1, Jan 9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
To my (crypto noob) eyes, it seems like second preimage resistance is just a specific case of collision resistance. In both, we're trying to find two messages that have the same hash value, but with collision resistance, we can choose the first one arbitrarily. The last sentence, saying that collision resistance is a higher barrier than second preimage resistance, thus doesn't seem to make much sense to me. What am I missing?
EDIT: I agree with sibling comments.
Suppose your function is collision resistant, but not 2nd-preimage resistant. Then this means we cannot find an arbitrary pair (x, y) such that H(x) = H(y). But given a fixed x, H(x) we can find y such that H(y) = H(x). This is of course absurd, since we can easily turn the latter 2nd-preimage attack into a collision attack by fixing some arbitrary x ahead of time.
It is also the case in practice that collisions are easier to find. This is owed to the fact that a collision attack has much more degrees of freedom given to the attacker than a (second) preimage attack.
Historically, many hash functions have been broken by collisions, but even very "weak" hash functions (i.e. MD5) still have full design strength for preimage and second-preimage resistance (as far as I know).
Thank you for the article. I found it interesting to think about.
dfc@ronin:~$ host cert-test.sandbox.google.com |grep address |wc
16 64 894
dfc@ronin:~$ host www.google.com |grep address |wc
6 25 262
I wanted to see how the various vendor ssl tests would handle sha256. Everything i tested had no problem, but they all took a little longer than usual because of the number of DNS results.PS Not that it would matter but unlike other google hosts the cert-test does not have any IPv6 records.
H(m) = x = H(m')
Where m is the original message, x is its hash, and m' is the second message that you need to find.For a preimage, you're given a value of x, and you don't even know what m is.
For a second preimage, you're given a value of m to start from. (And, thus, you know x.)
For a collision, you get to pick any m (and x) that you want to make your collision work. This last case is easiest to work with, since you can set up the messages in whatever way you need to exploit even a very subtle vulnerability. In a second preimage attack, the original message is given to you, so it may not set things up in an easily attackable way.
In a sense, a second preimage is a specific case of a collision. The critical difference is that a second preimage is a targeted collision.
One reason is a lot of hash functions are iterative in nature (you have a compression function repeatedly applied to a state, mixing the message into the state in small pieces). For collision resistance, finding a collision in just the compression function (or a limited number of applications of it) is enough to find a collision in the whole hash function (you can 'work outwards' from the collision). You can't use that effect in second order preimage resistance.
IANAC.
For comparison, the current global annual energy consumption is estimated to be ~2^47 kWh [2].
However efficient your hardware is, multiplying the energy-per-hash by 2^128 results in an impossible number.
Let's say that you have a magic device that computes the total, current Bitcoin hashing rate (75 million GH/s) with just a watt of power.
# Total hashes per second
>>> 75 * 1000000 * 1000000000
75000000000000000
# Energy/sec over hashes/sec gives energy/hash in joules.
>>> float(1) / _
1.3333333333333333e-17
# Energy to find a collision.
>>> _*(1<<128)
4.537098225612513e+21
That's roughly "estimated energy contained in the world's natural gas reserves as of 2010": http://en.wikipedia.org/wiki/Orders_of_magnitude_(energy) or ten years of "total world annual energy consumption in 2010".
I tried loading https://cert-test.sandbox.google.com/ in Android 2.3, the earliest version of Android that I care about. This is an OS that has given me much pain because it doesn't support SNI. So I was pleasantly surprised to find that it recognizes the SHA-256 certificate just fine.
What about OSX and iOS?
GlobalSign for example: https://www.globalsign.eu/ssl-information-center/transitioni...
And generally: https://casecurity.org/2014/01/30/why-we-need-to-move-to-sha...