A
A
Adik Izat2020-03-12 21:18:16
Algorithms
Adik Izat, 2020-03-12 21:18:16

How to create your own dictionary using iterations?

I want to try to write my own dictionaries for various hashes: md5, sha-256, sha-1, DES, RSA. So that in output-file.txt you can see something like (for md4 hash):

bde52cb31de33e46245e05fbdbd6fb24:a
7aeafcb2818e533b384433dea80992f5:b
9a8b795af56c9a4e3d2fc23794edc209:c
5d3f7ed29552c4ab4612fb7686bb52bb:d

What I have?
1) Alphabet of available characters (abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 _-+!?)
2) The number of characters in the input string does not exceed 20 characters
3) The hash of the input string is
known 4) The hashed string is known

I'm trying to write even in python, but I'm stuck.
import hashlib
# доступные символы
stringAvailable = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 _-+!?"
availableSymbols = list(stringAvailable)
# hashtype
hashtype = 'md4'
# максимальное количество символов в генерируемой строке
maxsize = 20
# массив в котором буду хранить строки и их хеш-суммы
generated = {}

def generate(symbols, size):
    #...
    string # должна быть сгенерированная строка входа
    hashed = hashlib.new(hashtype, string.encode("utf-8")).hexdigest() # хеш сумма
    generated[string] = hashed
    #...
generate(availableSymbols, maxsize)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-03-22
@JaxAdam

I have hash 647ecbe1a0666a9022f96eb402ce8124. How can I get a string that gives the same hash amount?
You need to write not a brute, but a reverse hash: finding all areas when intermediate values ​​converge to form a correct source string (more precisely and most likely, a list of matching strings or, in other words, all "collisions" of a given hash).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question