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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!