Encryption & Bruteforcing

Hi y 'all. So I am currently trying to do a project in python2 and python3. Basically I’m trying to study how to bruteforce a encrypted ‘password’ in lets say SHA-1 and MD5. I’m not asking for the answer, but I’m trying to understand why it’s important to use hashes and salts along with the hashes.

Btw, my ‘encryption’ program is here:

https://bin.0x00sec.org/?b60c9c1e45fe8e56#rSCqD1Xosm+xKfbpiOEcosm6gJ7rKTW+4TRd/hJyeBk=

Anyways, yeah. I just am confused and have no idea if my sources are correct. Any help is appreciated. Thanks!

With that all being said, ~Cheers!

–Techno Forg–

2 Likes

You might wanna check out the theory and explanation behind a hash and a salt in cryptography. Here’s a couple of links I found that I thought explained it quite well.


1 Like

Well, you are not really using SHA1MD5 with and without salt but plain SHA1/MD5 and bcrypt (which is completely different hashing method).

If you want to implement a simple bruteforce, you can use python’s itertools:

    from itertools import product
    from hashlib import md5

    test_hash = '098f6bcd4621d373cade4e832627b4f6' # md5(test)
    n = 4
    chars = 'abcdefghijklmnoprstuvxyz'
    for i in range(1,n+1):
        for j in product(list(chars), repeat=i):
            s = ''.join(j)
            m = md5()
            m.update(s)
            if m.hexdigest() == test_hash:
                print "Found: %s" % s
                exit(0)
2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.