Write a password cracker program for the passwords created according to the policy outlined in assignment 15 (exactly 8 characters: 5 letters and 3 digits). You are to write a function that takes one parameter that is a hash of a password and should return a possible password (a string) that has the same hash. Use python secure hash function sha1 from hashlib module. Hint: brute force method will be more than adequate to the task.
Please I need it as python program
import hashlib
# function takes one parameter that is a hash of a password
# returns a possible password (a string) that has the same hash
def get_password(password_hash):
# use brute force method to crack the password
# password is exactly 8 characters: 5 letters and 3 digits
password = [0, 0, 0, 0, 0, 0, 0, 0] # create a password array of size 8
possible_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
# create password with all possible combinations
# loop 8 times for 8 character in password
# loop for all possible letters
for ch1 in possible_letters:
password[0] = ch1
for ch2 in possible_letters:
password[1] = ch2
for ch3 in possible_letters:
password[2] = ch3
for ch4 in possible_letters:
password[3] = ch4
for ch5 in possible_letters:
password[4] = ch5
for ch6 in possible_letters:
password[5] = ch6
for ch7 in possible_letters:
password[6] = ch7
for ch8 in possible_letters:
password[7] = ch8
# convert array into string
string = ""
for i in range(8):
string = string + password[i]
# create a hash for the string
string_hash = hashlib.sha1(string.encode())
# now compare string hash and password hash
if string_hash.digest() == password_hash.digest():
# return the string as it is the password
return string
# main method to run the program
def main():
# create a password (with 5 letters and 3 digits) to hash
password = "aR3fg57Q"
# hash the password by using sha1 function
password_hash = hashlib.sha1(password.encode())
# crack the password using our function
cracked_password = get_password(password_hash)
# print the password
print(cracked_password)
if __name__ == '__main__':
main()
Write a password cracker program for the passwords created according to the policy outlined in assignment...
4.16 LAB: Password modifier Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string. • i becomes ! • a becomes @ • m becomes M • B becomes 8 • o becomes Ex: If the input is: mypassword the output is: Mypassw.rdq*s Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the given password...
**IN JAVA** Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string. i becomes ! a becomes @ m becomes M B becomes 8 o becomes . Ex: If the input is: mypassword the output is: Myp@ssw.rdq*s
Write a program that asks the user to enter a password, and then checks it for a few different requirements before approving it as secure and repeating the final password to the user. The program must re-prompt the user until they provide a password that satisfies all of the conditions. It must also tell the user each of the conditions they failed, and how to fix it. If there is more than one thing wrong (e.g., no lowercase, and longer...
i need know how Write a program that tests whether a string is a valid password. The password rules are: It must have at least eight characters. It must contain letters AND numbers It must contain at least two digits It must contain an underscore (_) Write a program that prompts the user to enter a password and displays the password entered and whether it is valid or invalid.
Write a program that inputs a string from the user representing a password, and checks its validity. A valid password must contain: -At least 1 lowercase letter (between 'a' and 'z') and 1 uppercase letter (between 'A' and 'Z'). -At least 1 digit (between '0' and '9' and not between 0 and 9). At least 1 special character (hint: use an else to count all the characters that are not letters or digits). -A minimum length 6 characters. -No spaces...
8.4 in python
function that checks whether a string is a valid password. Suppose the pas rules are as follows: . A password must have at least eight characters - A password must consist of only letters and digits. ■ A password must contain at least two digits. Write a program that prompts the user to enter a password and displays valid password if the rules are followed or invalid password otherwise (Occurrences of a specified character) Write a function...
1. Write a C++ program called Password that handles encrypting a
password.
2. The program must perform encryption as follows:
a. main method
i. Ask the user for a password.
ii. Sends the password to a boolean function called
isValidPassword to check validity.
1. Returns true if password is at least 8 characters long
2. Returns false if it is not at least 8 characters long
iii. If isValidPassword functions returns false
1. Print the following error message “The password...
In Java, I have created a program which can generate passwords. Currently the program can generate a password through a menu system of which characters to use. To complete the project, I need a system which allows the user to generate another password after the first password is created. I also need a method to check whether or not the password is complex by checking if the generated password has 3 or more character types and then displaying whether or...
Part 1: Is this Crazy Password Valid? A good password (in this strange system) should have the following properties: Rule 1: The password should be between 4 and 25 characters inclusive, starting with a letter. Rule 2. The password should not be contained in a list (selected by the user) that contains passwords commonly used by many people thus making these passwords easy to guess. Comparisons with passwords from the list of common passwords should be case insensitive. For example,...
A CERTAIN program to user's password containing rules such as
least n length, one uppercase, lowercase, one digit and white space
is given as the code down below. So, simiiar to those rules, I need
the code for the following questions post in pictures such as no
more three consecutive letters of English alphabets, password
should not contain User name and so on.
//GOAL: To learn how to create that make strong passwords
//Purpose: 1)To learn some rules that makes...