Tell me more ×
IT Security Stack Exchange is a question and answer site for IT security professionals. It's 100% free, no registration required.

How would we go about factoring Moore's law into exceedingly long password cracking estimates?

Let's say we've got a 12 character password containing mixed-case alpha characters and numbers, i.e. a-z, A-Z and 0-9. The keyspace for such a password is roughly 3.2x1021.

Now, let's say I can currently compute hashes at a rate of 3.0x109 (three billion) per second on a modern GPU. At that rate, using the same hardware, I could search the entire keyspace in 33,824 years.

However, if I can migrate across to newer hardware as it comes out, this figure is likely to be significantly less.

Assuming the following:

  • Transistor counts double every 2 years.
  • Hash computation speed is directly proportionate to transistor count.
  • Hash computation speed is not bound by other constrains (e.g. memory bandwidth)
  • There is no upper limit on transistor count.
  • We can transition to new hardware immediately.
  • We're looking for an absolute lower bound on the total cracking time.

How would we go about computing the length of time it would take to crack the hash? Is there a mathematical formula that expresses the geometric progression?

share|improve this question
1  
not sure I can comment on the main thrust but I'd say that if you're looking to work out a "secure" password it's not just faster GPUs you have to worry about. Commercial password cracking is starting to make use of FPGAs (blog.crackpassword.com/2012/07/…) which look to be a LOT faster (the graph in that blog post is quoting a 17x speedup from a fast GPU... – Rory McCune Jul 26 '12 at 21:49
@RoryMcCune I'm aware of FPGA / CPLD cracking units (I dabble in digital electronics) but I'd like to keep the scope limited to consumer hardware. As the parallelization of GPUs increases the gap between FPGA and GPU will grow smaller. – Polynomial Jul 26 '12 at 22:01

3 Answers

up vote 4 down vote accepted

It will be significantly less. I would just set up a recurrence relation for this like so:

A(n) = A(n-1) - C * 2 ^ (N-1) and A(0) = size of keyspace, say 62^12

lets set C = 3.0*10^12 for hashes computed the first year and assume computing power doubles every year.

Plugging this into wolfram alpha yields this function solution for the recurrence relation:

recurrence relation...

f(x) ~= 3.22627x10^21 - 3.0x10^12 * 2^x

Solve f(x) = 0 for x:

x = lg (3.22627x10^21 / 3.0x10^12) where lg is log base 2

x ~= 30.00226 years

Cracked in 30 years, but that's a lot of silicon, no wasted work, and you would need a method to seemlessly integrate new hardware into the running program without stopping it.


Explanation:

So we have the original key space size: 62^12 and a hypothetical machine capable of incorporating Moore's Law, somehow.

My original math was off a bit. For some reason I did 3.0 x 10^9 * 1000 = 3.0 x 10^12 for calculations in a year, but it should be 3.0 x 10^9 * 3600 (seconds / hour) * 24 (hours / day) * 365 ( days / year). Anyways, that's our initial speed, which according to Moore's law will double every year. I'm going to keep the original mistake for consistency in explanation.

So in the first year, we perform 3.0x10^12 hashes of the 1.0x62^12 maximum hashes needed (assuming worst case scenario). In the second year, Moore's law applies and now we do 6.0x10^12 hashes in the second year, which gives us cumulatively 9.0x10^12 hashes calculated so far. The hashes we have left to do are found via subtraction from the whole number of hashes. We'll run the program until there are no more hashes to find.

A(N) = A(N-1) - C * 2^(N-1)

A(N) is the number of hashes remaining after this year

A(N-1) was the number of hashes previously remaining before this year

C is the initial speed

N is the number of the year (first, second, third, etc).

So every year the speed doubles, which is the 2^(N-1) part of the equation. C is the initial speed for the first year, so we have C * 2 ^ 0 = C * 1 = C. In the second year, the speed has doubled once, so we have 2 * C. In the third year, speed has the doubled from initial twice, so we have 2 * 2 * C = 2^2 * C = 2^(N-1) * C since N is 3. This forms a recurrence relation for the number of hashes left to compute.

Using a combinatorics book, you can transform a recurrence relation into a generating function. Or wolfram alpha can do it for you, if you're like me and remember generating functions can be found but have forgotten how to find them since that math class seven years ago.

Anyways, you get a function of x where x is still the year being iterated. f(x) is how many hashes are left to compute. We're done when there are 0 left. So we solve f(x) for x when f(x) = 0. The last part is algebra.

I might be off base here, but it makes sense to me :)

share|improve this answer
forgot to mention, zero downtime on that hash crunching as well – Peter Smith Jul 26 '12 at 22:54
2  
This also assumes perfect hashing with 0 collisions. Time will be considerably shorter if two passwords can hash to the same value. – Peter Smith Jul 26 '12 at 22:57
Since there's no easy way to compute a probability of hitting a collision, I think it's safe to assume that a lower bound absorbs some of that. – Polynomial Jul 27 '12 at 5:45
Also, could you explain the math a bit? I'm trying to figure out exactly how you computed this - a formula with generic parameters instead of the numbers would be great. (sorry, it's ~6.30am here, not yet awake enough to reverse engineer math!) – Polynomial Jul 27 '12 at 5:46
@Polynomial math explanation added of my possible solution – Peter Smith Jul 27 '12 at 23:03

Assuming computing power of the attacker can be expressed exponentially over time:

p = a·ebt

where t is time (t = 0 when the attacker starts trying passwords), a and b are two constants, and p is a measure of power expressed in "password tries per time unit", then the size of the space of passwords explored by the attacker over time period T is:

S = \int_{0}^{T} p·dt = \frac{a}{b}(e^{bT} - 1)

Moore's law more or less means that the exponential-based formula is a valid model -- within some limits. An optimistic expression of Moore's law is that, over the course of three years, transistor density has quadrupled and clocking frequency has doubled at constant budget: for the same cost, we have four times as many transistors and we can run the circuit twice faster. This would mean that b = 0.693 inverse years (logarithm of 2: power doubles every year; we express time t in years) and a is the number of passwords that the attacker can try right now with his yearly budget (say, a = 3×1017 passwords/year if the attacker begins at 10 billions per second, as would be the case for a simple salted MD5 hash and a few thousands of dollars of budget).

The calculation above assumes the following properties, which are not very realistic:

  • The attacker has a renewable yearly budget, allowing him to perform regular hardware updates.
  • Conversion from old to new hardware costs nothing, which is akin to declaring that software grows on tree and you just have to walk below the branches with a basket.
  • The attacker can follow Moore's law. Password cracking is highly parallel, but this will still need to play with FPGA. Consumer products like CPU or GPU have other constraints which prevent them from obtaining the full power of Moore's law (in particular, memory latency does not scale as well).
  • Moore's law holds. Gordon Moore himself, back in 1997, gave it about 20 more years before falling apart, i.e. until about year 2017 -- which is only four years away. Moore's law operates on the gradual application of a stock of optimization ideas which have been expressed, at least theoretically, in the 1970s. That stock is fast running out... and, indeed, we can see that clocking frequency in circuits (even ASIC) has somewhat stalled below 10 GHz.
  • We can ignore energy consumption. We now know that this is not true. Energy is now a major constraint on big computations (not only for feeding the machines, but also for cooling, because all that energy becomes heat). It is also the closest boundary on theoretical computing power.

Therefore, while you can use a formula like the one I showed above, the results you will get out of it will not be very practical. I would like to add that if the attacker is sufficiently intent on spending hardware on a yearly basis in order to crack your password, then that guy is indeed your arch enemy; it won't be long before he realizes that hiring two or three thugs to break your kneecaps is vastly cheaper and more effective.

share|improve this answer

I could do the math given your assumptions, but the result would have little practical relevance, because your assumptions are not valid and your problem statement is missing some important context. Doing the math here without questioning the assumption would be like one of those physics jokes that begins "assume a spherical cow..."

For example, it is not reasonable to expect transistor count to increase at an exponential rate indefinitely. Power consumption scales linearly with transistor count, so you're going to hit a brick wall sooner or later on that front. In general, power is one of the main limiting factors for CPUs these days. Projecting the effect of an exponential curve over 30 years is a bit silly, as it ignores the power wall.

Second, it is rare to have a password that needs to remain secure for 30 years. In most situations, rather than trying to pick a password that will remain secure for 30 years, it is better to simply change your passwords every so often.

Third, when we are talking about a 12-character mixed-case alphanumeric truly random password, password cracking is unlikely to be the weakest link in your system. There are almost certainly going to be easier ways an attacker can defeat security.

So while I'm perfectly capable of doing the mathematical calculation under your assumptions, I'm not going to do it. It would be an exercise in mathematical masturbation. Don't me wrong -- I enjoy mathematics for its own sake -- but in this case the results would be misleading.

In short, my answer is: you are asking the wrong question. A truly random 12-character password is more than enough for the foreseeable future. If your password is that strong, stop worrying about password cracking and spend your energy defending against other threats.

share|improve this answer
+1, agreed, my answer is not meant to justify this as a likely scenario. – Peter Smith Aug 2 '12 at 20:20
For that matter, Gordon Moore himself predicted in 1997 that his law would hold for about 20 more years, i.e. up to year 2017. After that, we will have really run out of all the optimization ideas that were conceived in the late 1970s. – Thomas Pornin Jan 13 at 22:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.