Hacker News new | ask | show | jobs
by politelemon 1587 days ago
Password is randomized on each load. Author has conveniently left a debugger statement in the code.
2 comments

Part of me wishes the author just took common passwords from rockyou.txt so that they're at least guessable. Though random really does add to the absurdity.
Or use a new password every day like worle. So you have a community effort to guess it
That sounds like Bitcoin with extra steps

Jokes aside, that would actually be fun if the password is actually reasonably guess-able, I would definitely give it a try if that existed

Oh no, now someone will make wordlecoin, where you have to work with others sharing hints to mine each block.
Proof-of-Wordle
Is any of the information (yellow/green for characters) presented getting you closer to the real answer in any meaningful way though?
According to the best current knowledge of humanity, it provides no information whatsoever.

However, proving that is difficult. It is possible that there exists an algorithm that could narrow in on the answer from hashes. Such an algorithm could run quickly, but it could also potentially take quite significant computation. We don't know what the true, optimal answer to this question is.

> According to the best current knowledge of humanity, it provides no information whatsoever.

??? My first guess has two green letters, or 8 bits of the hash are known. This excludes 255/256 of possible passwords-- so if there's a dictionary, it's way cut down. I also know for the other 30 digits a value that they are not-- this is about .1 bits apiece, for 3 more bits. And I get a few more bits from knowing the population count for each digit.

One guess has reduced the search space by a factor of 10000+. If I say, know the word is in /usr/share/dict/words, the number of possibilities has dwindled from 230,000 to something around 20.

Now, in this case, with a 14 character randomized password-- the amount of benefit is limited. The search space is still significantly shrunk by each guess, but in a way that is difficult to iterate.

This is one of those places where it's easy to conflate computer bits with information theory bits. You may have eight computer bits, but in order for you to have eight bits of information, you must have your search space cut down by a factor of 256, not just the abstract concept of a search space cut down.

Can you enumerate the remaining 1/256th of the search space? Not with anything other than a brute force search, minus the one password you tried. The exact same brute force search that you would have needed to solve the problem in the first place. Your one password attempt has yielded one password's worth of knowledge. You, a human, don't have eight bits of information. You have almost nothing.

In principle, such a guess does eliminate 8 bits of information, but we have no way of manifesting that. In principle if we had a full list of the shortest passwords that led to the given hash, we could strike off the non-matching entries, but no human can do that. In principle an easier algorithm than the brute-force search exists, but we have no idea what it is, and we don't know what it would look like, whether it would be an incremental improvement over brute force or if there's hypothetically an algorithm that could do it on your cell phone in a couple of seconds or what.

Hashing and cryptography in general hide in this space between the theoretical information leakage and the practical inability to do anything with it. You have 8 theoretical bits and just shy of 0 real, practical bits.

"??? My first guess has two green letters, or 8 bits of the hash are known. This excludes 255/256 of possible passwords"

Sha256 is a one-way hash. Knowing some of the sha256 doesn't tell you anything about the plaintext.

Put another way, the matching SHA characters are just a decoy. That's the joke. They could give you the SHA256 hash up front and you'd still have to search the entire password space.

Are you sure thats how evenly distributed hash algorithms work? change one letter of your string, or just make it longer or shorter - none of your green fields will stay.
Inherently with a (proper) hashing algorithm, the value and placement of characters in the hash means next-to-nothing in terms of the actual original text. For example:

password = 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

passwurd = 1966e583daff0fce5630d5de44f303f0e77f77940f02c7d648defadc31059c7b

Notice they're very different results, even though the original text only has 1 character difference.

The Avalanche effect for anyone interested in reading more.

https://en.wikipedia.org/wiki/Avalanche_effect

No, that's the joke of the site.
It reduces the search space to find the hash, but not the search space of what hashes to that value.
Sort off, if you already have a lookup table of possible solutions.
... which you won't, because the space is too large (around 90 bits of entropy if I'm not mistaken, bit less, so 10^27-ish possible solutions).
My first try was "hunter2", then I gave up.
It's OK, the goal is to find a collision
I did not know about the debugger statement until I read your comment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... . Thank you.
Massively useful! I also recently learned you can right click a line of code in the chrome debugger to add a logpoint - i.e. "log the value of this expression when you reach this point in the code" - so I don't have to manually add console.log statements. Basically the reverse of discovering the debugger statement!
One more trick:

Add a conditional breakpoint with the condition: `value = "someOverrideValue", false` to make the breakpoint change the value when it is reached without actually stopping execution. Great for when you need state changed but the app is always trying to override it. Here's a video from a talk I gave five years ago that demonstrates that: https://youtu.be/uixXOTCNbhs?t=1182

Woah. Now that is incredibly useful.
It's also used by malicious websites that don't like security researchers looking at their source, just to say.
> you can right click a line of code in the chrome debugger to add a logpoint...so I don't have to manually add console.log statements

Thank you, this is the best thing I've learned in 2022.

Next try https://www.replay.io, which allows you to add logpoints to code that has already executed.
You can also right click a DOM element in the inspector and click `store as a global variable`. It will automatically do the following for you

temp1 = document.querySelector(SELECTOR_FOR_NODE_YOU_PICKED)

This was news to me too
It's pretty powerful. I oftentimes struggle to get VS code to pick up a breakpoint when debugging serverless node functions, but the debugger statement usually gets it working.