Question: Cracking the Password Generator API with Asynchronous - Multi Thread - Multi Process Programming. I want you to make a password cracker. You get the
Cracking the Password Generator API with
Asynchronous Multi Thread Multi Process Programming.
I want you to make a password cracker. You get the md encrypted text with a Get request and send your guess with a Post request. Your project will be evaluated on the following elements on a base score of points:
Asynchronous programming points
Multithread Multiprocess and synchronization elements points
API code is below:
from flask import Flask, request, jsonify
import hashlib
import random
import string
import json
app Flaskname
def generatepassword:
password join
random.choicesstringasciiletters string.digits, krandom.randint
return hashlib.mdpasswordencodehexdigest
@app.routegetpassword", methodsGET
def getpassword:
password generatepassword
response jsonifypassword: password
with openpasswordjson", w as f:
json.dumppassword: password f
return response
@app.routecheckpassword", methodsPOST
def checkpassword:
data request.getjson
password data.getpassword
passwordhash hashlib.mdpasswordencodehexdigest
with openpasswordjson", r as f:
storedpassword json.loadfgetpassword
if passwordhash storedpassword:
return jsonifymessage: "Success"
else:
return jsonifymessage: "Failed"
if namemain:
app.run
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
