Implementing a simple otp cipher


Assignment Task: Need in Python and not in Java language.

Task 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.

Task 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.

Task 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.

Task 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.

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

Task 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.

Task 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?

A number of students acquire their dream grades by availing our online service and because of their positive reviews and feedbacks, our OTP cipher Assignment Help service is considered as number one in the relevant industry.

Tags: OTP Cipher Assignment Help, OTP Cipher Homework Help, OTP Cipher Coursework, OTP Cipher Solved Assignments, RSA Cipher Assignment Help, RSA Cipher Homework Help, RSA Cipher Coursework, RSA Cipher Solved Assignments, Python Assignment Help, Python Homework Help

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Implementing a simple otp cipher
Reference No:- TGS03025595

Expected delivery within 24 Hours