Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # input name of hash only file
- f = raw_input('Hash only, file name? ')
- print f + ".txt"
- read_file = f + ".txt"
- g = raw_input("Hash:pass file name? ")
- print g + ".txt"
- pass_file = open(g + ".txt", "r")
- lines = int(raw_input("How many hash:pass lines? "))
- hashlength = int(raw_input("char length of hash? "))
- # Read in the file
- filedata = None
- with open(read_file, 'r') as file:
- filedata = file.read()
- for n in range(0, lines):
- # Desired outpt string (hash:pass)
- v = str(pass_file.readline()) # take out /n after readline
- q = str(v.rstrip('\n'))
- # Adjust length of hash type
- hashfind = str(v[:hashlength])
- # Writing
- filedata = filedata.replace(hashfind, q)
- # Write the file out again
- with open(read_file, 'w') as file:
- file.write(filedata)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement