Implement a simple OTP cipher

Assignment Help Python Programming
Reference no: EM132414277

Assignment - Need in Python and not in Java language.

1. We discussed the One-Time-Pad cipher and showed that Eve's guesses for the key are futile as she can get any reasonably looking result. Check that the second key she guessed indeed decrypts the ciphertext to "LATER". If it does, what should be the key stream to give "NEVER" instead. If it does not, correct the key so that you do get "LATER". You can (of course) write a computer program in the language of your choice to help with this.

2. Implement a simple OTP cipher (in Python or any other language) that uses XOR for encryption. That is, your program should be able to read key material from a file and combine it with the plaintext data from another file to produce ciphertext, and vice versa (ciphertext to plaintext). Otherwise, design, implementation or interface details are up to you.

3. Consider the RSA cipher. Assume that the following two prime numbers are selected, P=7 and Q=11. Compute N and W. Select a valid public exponent E. Given the selected public exponent E, compute the private exponent D. What are the public key and private key here? Show an example encryption and decryption with these keys.

4. During the lectures we have seen how the generic RSA encryption and decryption can be done in Java using the BigInteger numbers. Big integers are the default in Python, implement the same generic RSA algorithms in Python. For this you will need the modular power operation and modular inverse. For the first, you can use pow(x,y,z) which gives you x y mod z, for the second use Google to find a suitable implementation of the Euclidean algorithm in Python.

5. Following the same principles, implement the generic Diffie-Hellman scheme in Python as it was done in Java during the lectures.

6. For RSA, the generic algorithm that works on (large) integers is in essence the same as the crypto library implementation. The library implementation only differs from the generic one in that it:

• pads the data automatically to provide input of a fixed bit length, and

• transforms the character/byte input into a corresponding (large) integer.

Write a Python (or Java if you prefer) program that verifies that this is indeed one and the same thing by using one method (the generic one that you developed in exercise 4) to encrypt and the other (crypto library) to decrypt some message. To make this work you need to provide your own padding (and consequently use no-padding option with the crypto library) and represent character strings as large integers.

7. Come up with a method (describe it briefly) and write a program to measure RSA performance (encryption/decryption). Try different key sizes. What are your conclusions?

Reference no: EM132414277

Questions Cloud

Determining the liability of the government : Identify and describe generally the law(s) applicable to determining the liability of the government and its employees for injuries caused by negligence in:
Business proposal project : Throughout this course you will be completing an action research project based on a real organizational problem that you identify.
What do you think about the belief-action doctrine : Answer the following questions based on the Reynolds v. United States Case,Wisconsin v. Yoder Case and Gonzales v. O Centro Case
Is there a claim against the doctor : If suit was brought on Mr. Lark's behalf, what would have to be proven to be successful? Is there a claim against the doctor?
Implement a simple OTP cipher : Implement a simple OTP cipher (in Python or any other language) that uses XOR for encryption - design, implementation or interface details are up to you
Discuss the different legal actions mary could take : Mary attends work and advises her employer that she is pregnant. Shortly afterwards Mary finds her shifts are cut. Discuss the different legal actions
NoSQL Database Assignment Using MongoDB : ICT704 Non-Relational Database Systems Assignment help - NoSQL Database Assignment Using MongoDB solution, University of Sunshine Coast - Assessment Writing
The environment or globalization and business ethics : Write a three page essay on an issue of business and the environment or globalization and business ethics.
Describe topic information governance for cloud computing : Research paper topic is "Information Governance for Cloud Computing " and can be on any course-related topic in the field of Information Technology, Governance.

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