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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:30:26+00:00 2026-06-08T23:30:26+00:00

I use python 2.7, and I have a simple multitheaded md5 dict brute: #

  • 0

I use python 2.7, and I have a simple multitheaded md5 dict brute:

# -*- coding: utf-8 -*-

import md5
import Queue
import threading
import traceback

md5_queue = Queue.Queue()


def Worker(queue):
    while True:
        try:
            item = md5_queue.get_nowait()
        except Queue.Empty:
            break
        try:
            work(item)
        except Exception:
            traceback.print_exc()

        queue.task_done()


def work(param):
    with open('pwds', 'r') as f:
        pwds = [x.strip() for x in f.readlines()]

    for pwd in pwds:
        if md5.new(pwd).hexdigest() == param:
            print '%s:%s' % (pwd, md5.new(pwd).hexdigest())


def main():
    global md5_queue
    md5_lst = []
    threads = 5

    with open('md5', "r") as f:
        md5_lst = [x.strip() for x in f.readlines()]

    for m in md5_lst:
        md5_queue.put(m)    # add md5 hash to queue

    for i in xrange(threads):
        t = threading.Thread(target=Worker, args=(md5_queue,))
        t.start()

    md5_queue.join()


if __name__ == '__main__':
    main()

Work in 5 threads. Each thread reads one hash from queue and checks it with list of passwords. Pretty simple: 1 thread 1 check in ‘for’ loop.

I want to have a little bit more: 1 thread and few threads to check passwords. So work() should read hash from queue and start a new number of threads to check passwords (1 thread hash, 10 thread there check for passwords). For example: 20 threads with hash and 20 threads to brute the hash in each thread. Something like that.

How can I do this?

P.S. Sorry for my explanation, ask if you did not understood what I want.

P.P.S. It’s not about bruting md5, it’s about multi-threading.

Thanks.

  • 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-08T23:30:28+00:00Added an answer on June 8, 2026 at 11:30 pm

    The default implementation of Python (called CPython) uses a Global Interpreter Lock (GIL) that effectively only allows one thread to be running at once. For I/O bound multithreaded applications, this is not usually a problem, but for CPU-bound applications like yours, it means you’re not going to see much of a multicore speedup.

    I’d suggest using a different Python implementation that doesn’t have a GIL such as Jython, or rewriting your code to use a different language that doesn’t have a GIL. Writing it in natively compiled code is a good idea, but most scripting languages that have an MD5 function usually implement that in native code anyways, so I honestly wouldn’t expect much of a speedup between a natively compiled language and a scripting language.

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

Sidebar

Related Questions

I am learning how to use sqlite3 in python. I have a simple table
New to Python, have a simple, situational question: Trying to use BeautifulSoup to parse
I have a simple 3 column csv file that i need to use python
I use python 2.7. I have data in file 'a': myname1@abc.com;description1 myname2@abc.org;description2 myname3@this_is_ok.ok;description3 myname5@qwe.in;description4
You have a Python class which needs an equals test. Python should use duck-typing
i have an issue i could use some help with, i have python list
I have a Python script that makes use of 'Print' for printing to stdout.
I have a Python Facebook project hosted on Google App Engine and use the
I have 2 python scripts https://gist.github.com/2233477 . rsgen.py generates random inputs for use in
I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create

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.