I wrote this code but I do not know how to add my CSV files to it
import hashlib
import csv
from collections import OrderedDict
hp = OrderedDict()
akahr = OrderedDict()
def hash_password_hack(input_file_name, output_file_name):
with open(input_file_name) as fin :
reader = csv.reader(fin)
for i in range (0 , 10000):
x = repr(i).encode()
y = hashlib.sha256(x).hexdigest()
##print(y)
hp[y]= i
##print(hp)
for radif in reader :
name = radif[0]
hash = radif[1]
for hash_dakhele_hp in hp.keys():
if hash_dakhele_hp==hp.keys():
akahr[name]=hp.get(hash_dakhele_hp)
with open(output_file_name,'w') as out :
count = 0
for name in akahr :
count +=1
if count == 1:
out.write(name + ',' + str(akahr.get(name)))
else:
out.write('/n' + name + str(akahr.get(name)))
The code should read data from the input CSV file like this :
Danial,a19fbf8bf0530ca46179b803a8234f56276f21c0e7dc2f84c682924b95de5801
Check all the passwords made from 0000 to 9999 and add them to the dictionary and in dictionary find which hash password is like this and replace it with a password like :
Danial,1596
but its not working
New contributor
Beni is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.