Question
Task 1 { Get Familiar with RSA (5 points) The goal of this task is to get you familiar with RSA. You are given a
Task 1 { Get Familiar with RSA (5 points) The goal of this task is to get you familiar with RSA. You are given a RSA key pair (N; e) and d, and a unique encrypted message c. You are required to get the decrypted message m. Each student's key pair and cipher text can be found in \keys4student task 1.json".
TODO: In the provided crypto proj.py le, implement the function decrypt message 1 def decrypt message(self, N, e, d, c): m = 0 return hex(m).rstrip('L')
file:
import hashlib import json import math import os import random # You may NOT alter the import list!!!!
class CryptoProject(object):
def __init__(self): # TODO: Change this to YOUR Georgia Tech student ID!!! # Note that this is NOT your 9-digit Georgia Tech ID self.student_id = 'bdornier3'
def get_student_id_hash(self): return hashlib.sha224(self.student_id.encode('UTF-8')).hexdigest()
def get_all_data_from_json(self, filename): data = None base_dir = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(base_dir, filename), 'r') as f: data = json.load(f) return data
def get_data_from_json_for_student(self, filename): data = self.get_all_data_from_json(filename) name = self.get_student_id_hash() if name not in data: print(self.student_id + ' not in file ' + filename) return None else: return data[name]
# TODO: OPTIONAL - Add helper functions below # BEGIN HELPER FUNCTIONS # END HELPER FUNCTIONS
def decrypt_message(self, N, e, d, c): # TODO: Implement this function for Task 1 m = 0
return hex(m).rstrip('L')
def crack_password_hash(self, password_hash, weak_password_list): # TODO: Implement this function for Task 2 password = 'abc' salt = '123' hashed_password = hashlib.sha256(password.encode() + salt.encode()).hexdigest()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started