Well if he's forming a 10 digits random password the chances are roughly worst due to the change of repeating strings and never trying other strings.
But in the best possible case I can think of the string is let's say in the middle of the combinations and he be luck attempts less than the middle of combinations before guessing the password.
var start = confirm("Start Brute force attack");
if (start === true) {
var inputs = document.getElementByTagName("input")
for (var i = 0; i < inputs.length; i++) {
var rand = Math.floor(Math.random() * 10);
inputs[i].value = rand;
}
}
38
u/[deleted] Aug 22 '21
ep1c h@x0r
25
u/[deleted] Aug 22 '21
Imagine the odds of success, lol
13
u/Ethanlac Aug 22 '21
Your program is calling its attack like it's an anime character. "You fell for it, fool! START BRUTE FORCE ATTACK!"
10
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Aug 22 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
27
u/PPAPisLob Aug 22 '21
Nope, no one used tripple equals in Js in middle school.
3
u/Naughtius_K_Maximus Aug 22 '21
I see you've went to the Bogo school of algorithms too.
1
u/Melon_Chief Aug 23 '21
Ok… I'm not a JS dev. But doesn't Math.rand return a float between 0 and 1? 🤔
0
u/[deleted] Aug 23 '21
[deleted] — view deleted comment