Question: Python code needed: The goal of this project is to implement the One-Time Pad. Optional psuedocode: def KeyGen(n): Initialize a key to an empty string

Python code needed:
The goal of this project is to implement the One-Time Pad.
Optional psuedocode:
def KeyGen(n):
Initialize a key to an empty string
For each item in range (n):
Append a random bit to the key
Return the key
 Python code needed: The goal of this project is to implement

2 Challenge 1: KeyGen Write a function which generates the key for the OTP. This key should be randomly generated. For this, you must use the random module. The function should have input n, the desired key length, and output an n-bit random binary key INPUT: integer n OUTPUT: n-bit binary string Example: Input 3 output 110 Input 5 output 10110 Input 10, output 001 1000101

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!