Python Forum
how can I generate a password in hashlib
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can I generate a password in hashlib
#1
Hi
i have a csv file, it contain name and password. I am going to readout and write the password in a csv file.

import csv
import itertools
from collections import OrderedDict
import hashlib

with open ('code.csv', 'r') as input_file_name:
    reader=csv.reader(input_file_name)
    key=[]
    val1=[]
    for row in reader:
        name = row[0]
        val=[str(num) for num in row[1:]]
        key.append(name)
        val1.append(val)
        value = list(itertools.chain.from_iterable(val1)) #making a simple list from list of list in value
        value=[str(i) for i in value]
    print(key)
    dictionary = dict(zip(key, value))
print(dictionary)
my problem is, how can I generate password from the value in dictionary.
in the other words reach the password, I know the pass can be varied between 1000 to 9999.

sample input csv file:
Quote:peter,99b057c8e3461b97f8d6c461338cf664bc84706b9cc2812daaebf210ea1b9974
adam,85432a9890aa5071733459b423ab2aff9f085f56ddfdb26c8fae0c2a04dce84c
and the correct output:
Quote:peter,5104
adam,9770
Reply


Messages In This Thread
how can I generate a password in hashlib - by go127a - May-06-2019, 01:32 PM
writing on csv file problem, python - by go127a - May-14-2019, 12:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] How to crack hash with hashlib Milan 0 1,442 Mar-09-2023, 08:25 PM
Last Post: Milan
  Python3 hashlib ogautier 1 1,577 Mar-28-2022, 04:42 AM
Last Post: snippsat
  Confusion about Hashlib Vysero 2 3,012 Jun-25-2018, 04:05 PM
Last Post: DeaD_EyE
  Using SHA3 (keccak) from Hashlib CryptoFlo 0 7,763 Mar-14-2018, 10:56 AM
Last Post: CryptoFlo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020