You need to specify which attack you are talking about in order to claim that the "security" of a hash function is so-and-so. For a collision attack - finding two messages that hash to the same value - 2^128 attempts is required (to have a 50% possibility of finding it) for a 256-bit hash function. But in order to find which message hashes to a certain hash you need to try 2^256 combinations (for a 50% probability of succeeding).
Also, if a password has 2^80 combinations you need to try 2^80 combinations in order to have a 50% probability of finding the correct password, not 2^40.
Shouldn't that be 2^(N-1). ? In this case, 2^79 tries gives equal odds of finding the key.
You are correct. If you know a certain password can be found within 2^n combinations you only need to try 2^n combinations to be sure to find it (and 2^(n-1) combinations to have a 50% probability).
I was thinking of a pre-image attack. 2^n tries to have a 50% probability applies to a pre-image attack on a hash function (trying to find out what data hashes to a certain value). For example when searching for vanity Bitcoin addresses.
and again the attacker does not have to try this against lr's servers, once you have access to the hash you can do the attack in an offline manner, with the limit to how many hashes you an compute only being limited by your computing power.
What hash are you thinking about? I thought it was an API key. The only one who might hash this is the LR server.
and a hash function that has had a single collision found is considered cryptographically broken. so that is correct as well.
This isn't the case. Only if a hash function of n-bit entropy requires fewer than 2^(n/2) tries, on average, to find a collision is it considered broken.
For example, before the MD5 hash function was broken, an MD5 collision could be found with a 50% probability by searching through 2^64 combinations. This wasn't impossible to do, and if someone had done it MD5 wouldn't be considered broken.
I could even get extremely lucky and find a collision for SHA-256. But that wouldn't matter unless I could consistently find them trying less than 2^128 combinations, on average.