Question

Write a Python function named ‘genreate_sha256’ that generates all possible 7-digit pin and the corresponding sha256...

Write a Python function named ‘genreate_sha256’ that generates all possible 7-digit pin and the corresponding sha256 hash values and saves it into a file named ‘rainbow.csv’

Homework Answers

Answer #1
import hashlib 
import csv 

filename = "rainboww.csv"
fields = ['7digit_pin','hash_value']
with open(filename, 'w') as csvfile:  
    
 csvwriter = csv.writer(csvfile)
 csvwriter.writerow(fields) 
 for i in range(1000000, 9999999):
    arr = []
    arr.append(i)
    result = hashlib.sha256(str(i).encode()) 
    print(i)
    print(result.hexdigest()) 
    arr.append(result.hexdigest())
    csvwriter.writerow(arr) 

since the size of generated hash value file is 666 mb i couldnt upload the file.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Suppose that a computer randomly generates four-digit codes to match ATM pin codes among {0000, 0001,...
Suppose that a computer randomly generates four-digit codes to match ATM pin codes among {0000, 0001, . . . , 9999}. Explain carefully why there are 10000 possible four-digit codes when the digits are among 0-9. Note that 10000 = 104. Explain how this connects the number of digits, the choice of digits, and the possible four-digit pin codes. Among the 10000 possible four-digit pin codes, how many involve exactly three 1s or exactly three 2s? Write out the possibilities....
Exercise 48. Suppose that a computer randomly generates four-digit codes to match ATM pin codes among...
Exercise 48. Suppose that a computer randomly generates four-digit codes to match ATM pin codes among {0000, 0001, . . . , 9999}. Explain carefully why there are 10000 possible four-digit codes when the digits are among 0-9. Note that 10000 = 104. Explain how this connects the number of digits, the choice of digits, and the possible four-digit pin codes. Among the 10000 possible four-digit pin codes, how many involve exactly three 1s or exactly three 2s? Write out...
In PYTHON please: Write a function named word_stats that accepts as its parameter a string holding...
In PYTHON please: Write a function named word_stats that accepts as its parameter a string holding a file name, opens that file and reads its contents as a sequence of words, and produces a particular group of statistics about the input. You should report the total number of words (as an integer) and the average word length (as an un-rounded number). For example, suppose the file tobe.txt contains the following text: To be or not to be, that is the...
using Python: Write a function named safe input(prompt,type) that works like the Python input function, except...
using Python: Write a function named safe input(prompt,type) that works like the Python input function, except that it only accepts the specified type of input. The function takes two arguments: r prompt: str r type: int, float, str The function will keep prompting for input until correct input of the specified type is entered. The function returns the input. If the input was specified to be a number ( float or int), the value returned will be of the correct...
[Python] Write a function named "total_population" that takes a string then a list as parameters where...
[Python] Write a function named "total_population" that takes a string then a list as parameters where the string represents the name of a CSV file containing city data in the format "CountryCode,CityName,Region,Population,Latitude,Longitude" and the second parameter is a list where each element is itself a list containing 3 strings as elements representing the CountryCode, CityName, and Region in this order. Return the total population of all cities in the list. Note that the city must match the country, name, and...
PLEASE DO IT IN C++ ONLY. THE MIN-MAX DIGIT PROBLEM Write a function named minMaxDigit() that...
PLEASE DO IT IN C++ ONLY. THE MIN-MAX DIGIT PROBLEM Write a function named minMaxDigit() that accepts an integer as an input parameter and returns the largest and smallest digits using the two output parameters min and max. For example, the call minMaxDigit(68437, min, max) would set min to 3 and max to 8. If there is only one digit, then both min and max are set to the same value. The function has no return statement.
Write a python function that will taken in a df (dataframe) and return a dictionary with...
Write a python function that will taken in a df (dataframe) and return a dictionary with the corresponding data types. You may need to instantiate an empty dictionary in your function. The keys will be the column headers of the df and the values will be the data types.
Write a Python program named lastNameVolumes that finds the volumes of different 3 D objects such...
Write a Python program named lastNameVolumes that finds the volumes of different 3 D objects such as a cube, sphere, cylinder and cone. In this file there should be four methods defined. Write a method named cubeVolFirstName, which accepts the side of a cube in inches as an argument into the function. The method should calculate the volume of a cube in cubic inches and return the volume. The formula for calculating the volume of a cube is given below....
Write a single Python statement to create a variable named twoDecimals. The variable will hold the...
Write a single Python statement to create a variable named twoDecimals. The variable will hold the result of using a Python function to limit the decimal positions included in another variable ( manyDecimals , provided to you below). The resulting variable ( twoDecimals ) should have only two decimal positions. manyDecimals = 1.2568765214789
Lottery Number generator page 335 #2. Design a program that generates a 7 digit lottery number....
Lottery Number generator page 335 #2. Design a program that generates a 7 digit lottery number. The program should have an Integer array with 7 elements. Write a loop that steps through the array, randomly generating a number in the range of 0 through 9. Use the random number generator function. Then write another loop that displays the contents of the array. Create a flowchart using FLOWGORITHM. Please provide screen shot of flowchart using ONLY FLOWGORITHM and a sample output.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT