4 ms·
A neat way to improve on this would be to get a series of 3-5 challenges, especially if it's something like math and logic puzzles that build on each other, so
by cryptoquick 7y ago
A neat way to improve on this would be to get a series of 3-5 challenges, especially if it's something like math and logic puzzles that build on each other, so it's a multi-dimensional problem, so it's difficult to cache or precompute.
The hash of the answer is just a string that concatenates the answers, and the challenges always mixes them in different orders. One possible example:
1. Does Red combine with Yellow to make Green or Orange?
2. If the answer to the last question was reversed, what letter would it start with?
3. If you added that latter to the end of these words, which word would be most edible? Mac, Nam, Pi, Snak
answers:
orange,e,pi
Of course, you'd want to design the interface to support multiple choice selection.
I would also recommend against using MD5, since, even if the hash weren't known to the end user, which should be sufficient even in this case, the attack MD5 is most known for is the fact that it's trivial to generate text that could match any given hash, regardless of what was used to originally make it. It seems like a potential attack vector somehow, depending on the case, and it's not terribly harder to just use one of the many tried-and-true, known-not-broken cryptographic hashing algorithms. SHA-256 would be adequate.
I'm not 100% certain of all the logic behind this, there's always cases I'm not rigorous to consider, but I'd be interested in seeing how others might improve this approach in similar ways.
- kchamplewski 7y ago> it's trivial to generate text that could match any given hash Source on this? Wikipedia states what I have heard before which is that MD5 collision attacks are pretty trivial now, but carrying out a preimage attack as you describe remains theoretical at this time. https://en.wikipedia.org/wiki/MD5 https://en.wikipedia.org/wiki/MD5
- DownGoat 7y agoThere is a way to defate this that is much simpler, in the examples on the page 5 out of 7 examples has the answer in the question. Just do MD5 sum of every word/combination of words in the question and you would find the answer to many of the questions. This together with a targeted dictionary would propbably give you a very high success rate for little cost. MD5/SHA-familly hashes are inexpensive to compute, you can do billions of the in a second. If you cant find the answer, then just request a new challenge untill you find one you can answer.
- meehow 7y ago> it's trivial to generate text that could match any given hash Actually I don't know why there is some hash used at all. According to the example, answers are stored in a session. CRC32 would do the job as well. Or no hashing at all. You would need some better hash in case when user downloads it. I can imagine different flow where you would need some better hash: I.e. you have some secret token, hash it together with captcha answer, send question with good hash to a browser and user sends back answer together with a hash he got. In such flow there would be no need to store values in a session.