You have been hired to develop the One-Time Pad cipher for a company. You can use Java in the development. Your implementation must consist 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 consist 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. Please show your code.
I need help with this question please!
You have been hired to develop the One-Time Pad cipher for a company. You can use Java in the development. Your implementation must consist 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 consist 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.
Please show your code.
Please show screenshots of the demo for both encryption and decryption.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images