3
I'm wondering if it would be possible to utilize a Bitcoin or Litecoin miner to attack, say, a password database that uses PKBDF2 with HMAC / SHA-256. PBKDF2 uses multiple iterations of a PRF - usually HMAC-SHA1, but sometimes HMAC-SHA-256 - for protecting passwords. The idea is that these calculations have to be performed for each password, so that makes it more difficult for an attacker to test all passwords. The PBKDF2 method is defined in RFC 2898.
Sometimes statements are made that these functions are insecure because of attacks with ASICs and often total amount of Bitcoin SHA-256 hashes is shown as example of what can be done. Now I'm wondering if it would be possible to program a Bitcoin or Litecoin miner to find a password using brute force or a dictionary attack.
Assumptions:
- HMAC SHA-256
- the salt is known
- output of PBKDF2 is 256 bit (the output of the hash) or less
- "high" number of iterations, say 4K to 40K
To do this you would have to program HMAC using a single SHA-256. Furthermore, you probably would have to have a method to perform the iterations. The iterations use the same key (derived from the password) for HMAC but the data is dependent on the previous value. Obviously there also needs to be some way to generate or retrieve the candidate passwords.
Would it be possible to reprogram a miner to do this work, or are all the current miners too specialized to perform such operations? Is there a - possibly older - miner that can be reprogrammed to do this work?
Note that this question is about reprogramming/re-utilizing a hardware device. It is not a generic question of using the Bitcoin network to perform cryptographic tasks.
I've added Litecoin to the mix. Litecoin uses scrypt, which is already a Password Based Key Derivation Function in itself, which uses PBKDF2 as underlying PRF (hope that's OK, no answers yet).
@NateEldredge Good link, didn't find that reference. This is however not about the bitcoin network but about specific miners (as in: the hardware device). The answers of the other question seems only valid for the network itself. – Maarten Bodewes – 2015-09-16T13:49:44.533
Hmm, I just found out about Litecoin by browsing this site. I guess I should probably be looking at Litecoin instead of Bitcoin.
scryptuses PBKDF2 as primitive and asic's seem to be available. – Maarten Bodewes – 2015-09-16T13:59:54.7872Note carefully the argument you refer to in the second paragraph - it isn't claiming that Bitcoin ASIC miners can be themselves be used to crack SHA-256 passwords, but that they demonstrate that someone could most likely build ASIC SHA-256 crackers with comparable performance at comparable cost (or less). So security planning should assume that an adversary has access to such hypothetical ASIC crackers. – Nate Eldredge – 2015-09-16T16:45:38.847
@NateEldredge Yeah, that's the scary part, because at current speeds many passwords would be a doodle to crack. If you work at THash speeds per device, doing 4K rounds isn't that much anymore. If you could use throwaway miners it would only cost electricity - but that seems to be out of the question. – Maarten Bodewes – 2015-09-16T16:48:37.050