Decipher simple encrypted messages using a range

Assignment Help Python Programming
Reference no: EM133527720

Applied Cryptography Assignment

Assignment 1:
In this Assignment, you will be applying symmetric encryption, decryption, and hashing of data files using the Python programming language.

Learning Outcome 1: Explain the concepts and principles on which modern cryptography relies upon.
Learning Outcome 2: Employ adapted cryptographic tools and techniques to encrypt, decrypt and sign messages.
Learning Outcome 3: Decipher simple encrypted messages using a range of cryptanalysis methods.

The Assignment

Your mission, should you choose to accept it, is to take a given data file and a partially complete python file and finish the encryption / decryption / hashing / and collision checking activities outlined below.

While this is not a programming unit, you may, in the future need to explore how to use a new st

library to achieve a task. This assignment will get
you to look at the documentation for a small number of Python cryptographic libraries and apply those libraries to your problem. the main cryptography python library - can be used to provide some functionality to encrypt, decrypt, and hash files with symmetric cryptography and hash functions.

What we've provided for you:

1. birthday_aNack_statistics.py - A file that runs a simulated 'birthday aflack' scenario on a random sample of dates in a given date range and repols on the average number of attempts to get a collision.
2. crypto_a1_activity.py - A skeleton python file is provided in iLearn just under this specification . It contains functions to-be completed for this assignment.
3. assignment_answers.txt - A template text file for you to replace selected lines with your answers / outputs from programs.
4. two files, but you only need to use one of
them depending on your OS.
1. windows_data_encrypted.txt
2. mac_Iinux_data_encrypted.txt

Instruction
Setup: Put all of the files ( birthday_attack_statistics.py, crypto_a1_activity.py, assignment_answers.txt, windows_data_encrypted.txt,
mac_linux_data_encrypted.txt) into a folder and open that folder up in your chosen pyhon IDE (e.g. visual studio code).

Task 0:

a) run birthday_attack_statistics.py and copy the last line of the console output into the assignment_answers.txt file for subtask a. The console line should start with
"average number of attempts "

b) now, modify birthday_attack_statistics.py to start a search from your birthday date up until the assignment due date (24 September 2023). Use the lecture slides on the birthday paradox to calculate what your expected size should be for a 50% chance of a collision to have occured with this new date range. Run your updated birthday_attack_statistics.py and copy the new updated console output ¿ust the last line) for subtask b. In the line underneath, indicate if the average was close (within +-2 of what you calculated) or not close (outside 1he +-2 of what you calcualted).

Task 1:

You have been be given an encrypted file that a student has encrypted, but they forgot which student ID they typed. You suspect they might have used the student ID 4000000 instead of their student number.
• modify the task_1(...) function in crypto_a1_activity.py
• modify the decrypt_fiIe(...) function in crypto_a1_activity.py
to call the functions you need to try and decrypt a file. We've provided some empty functions in the file for you to complete with some guidance. You will also need to implement the decrypt_file(...) function for your task J to be completed.
Once you've completed the code, run your python code to decrypt the file and see what the output was: (how to run it...)

Windows users in vscode terminal: python crypto a1 activity.py 40000000 task1
windows data encrypted txt windows data decrypted txt
Mac / Linux users in vscode:
python crypto a1 activity.py
40000000 tasL1

mac Linux aa£a encrypLeo.LxL
mac linux data decrypted.txt

If you've successfully decrypted the file, then copy line 5 of the text file and paste it as your answer. Hopefully the text should be readable in English...

Task 2:

Now that you've successfully decrypted the file, what we would like to you to do is re-encrypt the file. You will need to add code into the task_2 function and also implement the encrypt_fiIe function
• modify the task_2(...) function in crypto_a1_activity.py
• modify the encrypt_fiIe(...) function in crypto_a1_activity.py
J) If you've successfully implemented the function, then you should be able to run the python file with student number 4O000OO0, take in your decrypted file, and then output to a newly encrypted txt.

2) Take the same decrypted file and encrypt it using your own student number. save the output file as task2.txt

3) & We will check the .start of your has with our version run with your student number.

Task 3:

use your student number to encrypt and decrypt the decrypted file. Write "Success:" or "not success" in your answer file for task 3. provide the first 2O characters of the encrypted file (which should be the same as task 2).

Task 4:

Hash the unencrypted data file using SHA256 and copy the hash into task 4

• modify the task_4(...) function in crypto_a1_activity.py
• modify the generate_hash(...) function in crypto_a1_activity.py

Task 5: hash the fiIe that was encrypted with your student number (task2.txt) and save the resultsin task5.txt copy the hash stored in the output file into the assignment_answers.txt file in task 5.

Attachment:- Applied Cryptography.rar

Reference no: EM133527720

Questions Cloud

What is the significance obesity and increased bmi : What is the significance obesity and increased BMI in the context of PCOS? Please provide references, please do not steal information.
What hospice care how do they differ : What Palliative Care and what Hospice Care How do they differ? How are they the same? When in the course of a disease process should patients and their families
How you plan to evaluate achievement of your practicum : how you plan to evaluate achievement of your Practicum Project objectives. What will the evaluation(s) measure and what information you can gain from that.
Discuss any ethical considerations associated with this : Describe a "typical" problem presented by families in treatment with intrapsychic or linear constructions (e.g., acting-out adolescent, absent father/ husband
Decipher simple encrypted messages using a range : Explain the concepts and principles on which modern cryptography relies upon and Decipher simple encrypted messages using a range of cryptanalysis methods
What are all of the things you are currently balancing : What are all of the things you are currently balancing? Work? School? Family? How well are you keeping balance in your life? What are some key things you feel
What is the relevance of psychiatric mental health nurse : What is the relevance of Psychiatric mental health nurse practitioner in identifying, diagnosing, treating and managing depression in an outpatient mental
Review of the information that you have gathered from : briefly touch upon the many aspects that were included in the milestones. Make sure to use citations as needed. Close with the potential solutions to burnout
Discuss how much power these stakeholders exert : Who are the stakeholders and/or power players in the policy of improving accessibility and outcome of mental health? Include both pro and con stakeholders

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd