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 7675401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:57:13+00:00 2026-05-31T16:57:13+00:00

I made a multi-threaded program in C++ to break passwords of 7 characters long

  • 0

I made a multi-threaded program in C++ to break passwords of 7 characters long (lower case characters only) using a brute-force algorithm.

My algorithm is mostly 7 nested for-loops going from a to z and testing every possible combination.

Right now, I’m dividing my work this way :
If I have 3 working threads,
Thread 1 : axxxxxx to ixxxxxx
Thread 2 : jxxxxxx to rxxxxxx
Thread 3 : sxxxxxx to zxxxxxx

So the 3 threads will go on and loop until they find a match.

The main thread will wait for the first thread to return.

My question is : Is this the best way to divide the work between my threads? Do you have any idea on how I could be more efficient?

Also, even if it’s not the main part of my interrogation, can you think of a better way than the 7 for-loop iteration?

(Please note that this program is for a school project and not for really cracking passwords)

  • 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-05-31T16:57:14+00:00Added an answer on May 31, 2026 at 4:57 pm

    If all keys are equally likely, and if the cost to evaluate a key is the same for every key, and if each thread can expect to be assigned to one CPU without very many interruptions (e.g. your process is the only CPU intensive one running), evenly partitioning the keyspace as you have done will be very efficient.

    If some of those assumptions are invalid, a more flexible way to structure the program would be to have one thread (producer thread) hand out key ranges to 1 or more consumer threads for processing. Once a given thread completes its chunk of work, it would go back to the producer and request a new key range to analyze.

    There’s some overhead in the producer/consumer pattern, but it is more flexible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing a large multi threaded C++ program (> 50K LOC). As such
I'm having a very tough time debugging a multi-threaded C application that I've made
I made the ultimate laugh generator using these rules. Can you implement it in
I made small program to divide large pictures and take part of them. When
I am working on a multithreaded program using C++ and Boost. I am using
I'm writing a multi-threaded server application in Java. Everything works fine , but there's
I am trying to execute a multithreaded program, using the Executors of Java. On
I have made a java GUI program and have added a jList on that
I have a multi-threaded environment in .NET that needs to communicate to a library.
Iam trying to configure nutch for running multi-threaded crawling. However , Iam facing an

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.