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 program that prompts the user to enter a point

Write a program that prompts the user to enter a point with x- and y- coordinates and determines whether the point is inside the triangle.

  Write a simple pyhone program to encrypt and decrypt

Write a simple pyhone program to encrypt and decrypt a file using AES algorithm (key value: " security").

  Project will be a simple, working program

This programming project will be a simple, working program, using Python language, which utilizes a good design process and includes:Sequential, selection, and repetitive programming statements as well as,At least one function call.

  Write a function to convert celsius to fahrenheit

Write a 2-part program as follows: Write a function to convert Celsius to Fahrenheit. Write a function to convert Fahrenheit to Celsius.

  Create a list called readinglist with two books

Define a function called printList that takes in a list as a parameter and prints the entries in the list one entry per line. If the list is empty have program.

  Use python code allows user to use a menu to select number

You need to use python code allows the user to use a menu to select and then generate pick-3 or pick-4 lottery number generator.

  How would you represent the game as a collection of objects

How would you represent the game as a collection of objects? What entities do you think are in the game that should be modeled as an object?

  Find a python script

Find a python script

  Create a cheat commands in the game so player can teleport

Create a cheat commands in the game so player can teleport to any location in the map - The first four tasks in this section can be completed by modifying only the code within the ProcessStatement() and Game() functions. This section typically requ..

  Topic of effective and ethical communication

Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list.

  A stack data structure that uses a linked list for storing

In Python, implement a stack data structure that uses a linked list for storing its elements. In particular, you will need to implement the following three functions: 1. top(): This function returns the element that is at the top of the stack, but it..

  Implement and evaluate three learning algorithms as python

You are to implement and evaluate three learning algorithms as Python classes: A "classic" Decision Tree learner, a Random Tree learner

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