You have been hired to develop the One-Time Pad cipher for a company. You can use any languages such as Java, Python, C++ in the development. You implementation must consists of the following two functions: Encrypt(plaintext, key) and Decrypt(ciphertext, key). Encrypt function returns the ciphertext of the input plaintext, and Decrypt function returns the plaintext of the input ciphertext. The plaintext and ciphertext only consists of capital letters from ‘A’ to ‘Z’ and some spaces. You can also use pseudo random number function to generate the key in the program (in ideal scenario, we need to use the genuine random number generator). Note that, the key should be at least as long as the plaintext/ciphertext.
You have been hired to develop the One-Time Pad cipher for a company. You can use any languages such as Java, Python, C++ in the development. You implementation must consists of the following two functions: Encrypt(plaintext, key) and Decrypt(ciphertext, key). Encrypt function returns the ciphertext of the input plaintext, and Decrypt function returns the plaintext of the input ciphertext.
The plaintext and ciphertext only consists of capital letters from ‘A’ to ‘Z’ and some spaces. You can also use pseudo random number function to generate the key in the program (in ideal scenario, we need to use the genuine random number generator). Note that, the key should be at least as long as the plaintext/ciphertext.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps