Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8479707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:06:25+00:00 2026-06-10T19:06:25+00:00

Before I get to the actual question I would like to clarify some things

  • 0

Before I get to the actual question I would like to clarify some things because I know how ridiculous “brute forcing with javascript” can sound when taken out of context :).

I’m working for my bachelor thesis at the end of which I aim to implement a proof-of-concept Javascript-based hash cracker. The idea is to work like this:
Users can submit a hash value along with information about the used algorithm. (Other) users can also click on a button on the website in order to participate in the cracking process.
The server’s task is to accept and split the submitted ‘orders’ into ranges, depending on the number of available workers. The ranges are then sent to the clients who clicked said button.

I am currently stuck with the two big questions of how to actually implement this brute force function.
So my main problem now is that, frankly, I’m not really that settled in Javascript yet. For starters, I would just use a hardcoded character set: alpha-numeric, lower and upper case, no special characters. Problem is I honestly have absolutely NO clue of how to actually implement the function that would try out al the character combinations, on how to program that. I can imagine using a normal array containing the charset, then two strings. One string would contain the range, the other will contain the tried combinations. So I would somehow have to iterate through the charset array and the strings maybe with cascaded for-loops or something, but I’m really stuck with the question of ‘how’ exactly :). I don’t expect any of you to actually provide me with the full source code for such a function (unless you want to of course), but I’d really appreciate some hints or explanations on how to implement such a brute force function. I’d also not bother about performance or optimized coding at this point, but rather about comprehensive coding, or whatever you might want to call it 🙂

Sorry if I got fuzzy on some details in my question. If so, tell me and I will of course try to clarify further.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:06:27+00:00Added an answer on June 10, 2026 at 7:06 pm

    Brute force style function over an alphabet. There are probably easier ways to do this.

    function brute(alphabet, match, int_start, int_stop){
        var a = alphabet, al = 0,                     // for alphabet
            m = match.toString(), ml = m.length,      // for our compare
            i = int_start || 0, j = int_stop || 0,    // range of numbers to test
            k = 0, l = 0, add = 0, sub = 0, diff = 0, // for building test string
            test = '', found = false;                 // test string and result
    
        if(i < 0) throw 'int_start must be at least 0';
    
        if(a.constructor !== undefined){           // We need a string or array as
            if( a.constructor.name !== 'String' && // our alphabet so we check for
                a.constructor.name !== 'Array' )   // correct input and modify if
                    a = a.toString();              // necessary, or if we can't, 
        }
        else throw 'Bad alphabet type';            // we throw an error
    
        al = a.length;    // shorthand length
    
        add = al;                             // when i=0, we start prefix here
        while(add <= i - sub) sub += add,     // then work out what we have to
                              add = add * al; // prefix our number with
    
        diff = add - sub; // shorthand to save calculations
    
        while( i < j ){   // actual brute force loop starts here
            test = '';       // empty any previous string
            k = diff + i;    // convert our number from "x" to "1x"
    
            while(k > 0){           // build it as a string
                l = k % al;         // get index of digit
                test = a[l] + test; // add digit to string
                k = ( k - l ) / al; // move digits along
            }
    
            test = test.substring(1); // cut off the initial "1" we added
    
            if(test.length === ml && test === m){ // compare test to what you want
                found = true;
                break;
            }
    
            i++;                  // prepare for our next loop
            if(i - sub === add)   // and if we need another digit
                sub += add,       // then recalculate our prefix
                add = add * al,   // and then
                diff = add - sub; // update the shorthand 
        }
    
        // brute force ended, let's see what we've got
    
        if(found === false) i = -1; // if not found, return -1 as index
    
        return [i, test, m]; // index found, string found with, what we were looking for
    }
    

    Then use via e.g.

    brute('0123abcd', '0c', 0, 20); // [14, "0c", "0c"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help, and before we get going, I know it is probably
I need to get the actual width and height of the shareddiv before populating
I know this has been asked before ( Get Absolute Position of element within
I am risking this question being closed before i get an answer, but i
Ok, before I get a ton of responses. I know you cannot talk to
I'd like to get some opinions about about usability in the following case: Target
I have tried to ask a variant of this question before. I got some
Before I get to my question/problem, here is the basic structure of my application:
I would like to get the updated DOM html string for the form elements
Before I get anywhere with this post, let me make this clear, there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.