r/javahelp • u/[deleted] • May 12 '21
Theoretical password cracking.
Okay, so no I'm not trying to hack into someone's account or anything like that. Originally this idea came up when I had a password protected ZIP file I forgot the password to. From what i understand, passwords are usually hashed. Then when i would enter a password, whatever i enter would then be hashed using the same algo, and compared to whatever the actual password is.
To check if passwords match, I'm assuming they would be iterated over, then if one of the hashed values are not correct, it would return from the function with an error.
Would it be possible, to calculate the time it takes to iterate over a single character. (the time you click submit compared to the time of the error message) Then use that time, to figure out the exact character that was wrong, change it and try again repeatedly until you have the correct one?
Im genuinely curious as to if something like this would work. In my head it seems relatively simple which is why i know it most likely wouldn't work, but would love to hear why it wouldn't. Thank you!
4
u/hopespoir May 12 '21
No. It doesn't work that way.