r/ProgrammerHumor • • Oct 23 '26

Meme thereGoesCustomerTrust

Post image
8.8k Upvotes

261 comments sorted by

View all comments

Show parent comment

21

u/Real-Self-3039 Oct 23 '26

I mean tbf its a brute force attack, its meant to try to try every possible value. Doing some random order just makes the job more complex because it needs to then rememebr every combination it has tried

3

u/SinisterCheese Oct 23 '26

I think this would benefit from the weird thing that, you should work from the highest and lowest number. And from the high work downwards, and lowest work upwards. This narrows the options down quickest and you don't need to "remember" what you did.

This is if you just did 1 guess at a time. Practically you could divide the task into many segments, and then do the same between each of them. Like it would still be massive amount of bruforcing, but... like... Computationally you could divide the task into small blocks and spread it out. The longer you do this without a hit, the higher the chance to finding it becomes.

This isn't efficient, I know that, we all know that. Especially since most efficient way to get the key is to manipulate a person to give it to you or grant you access to get it.

0

u/[deleted] Oct 23 '26

[deleted] — view deleted comment

7

u/Gunmetalstorm Oct 23 '26

The more keys you have already tried the more likely you are to randomly select one of them.

4

u/Psych_Art Oct 23 '26

Wrong. If you already tried 10,000 keys, you now have 10,000 times as many chances to hit one of those keys on the next check as you would to hit the actual key.

3

u/RyanStonepeak Oct 23 '26

I would argue a random number generator hooked up to a lookup running inside a while loop is definitely more complex than a for loop.

2

u/HawasYT Oct 23 '26

Only true for the first iteration, after that the odds of hitting a duplicate test just keep rising and at a surprising pace because this setup seems to be directly related to the birthday paradox.

Brute force as it stands isn't very efficient, you don't need to additionally brute force the brute force to gimp it any further

1

u/UniversalAdaptor Oct 23 '26

Yeah, but if you do it in order then the likelyhood of trying the same entry twice is zero.