Question: Please Help in Java for a beginner: In order to send a secret message, some form of encryption has been used since ancient times. In
Please Help in Java for a beginner: 
In order to send a secret message, some form of encryption has been used since ancient times. In a symmetric cipher, the sender encrypts the message with a private key that is only shared with the recipient. The recipient can then decrypt the message by using the exact same key. Since every character in the computer is represented as a stream of bits, encrypting a character means transforming its bit sequence. One way to transform it is to apply the XOR operator bitwise between the original character and another character, the secret key. The result of the operation is the encrypted character. The XOR operator is well suited for symmetric encryption, because the recipient can apply bitwise XOR between the encrypted character and the key and retrieve the original character. In short, if character c is encrypted with key k, then: d=eXOR k where e is the encrypted character and d is the decrypted character. By the definition of XOR, d should be equal to c Write a program that asks the user for a character to encrypt and another character that will be used as the key. Then, the program computes the encrypted character and the decrypted character as explained. Sample execution, where the user provides r and k Character to Encrypt: r Key: k Original in Binary: 1110018 Key in Binary: 1101011 Encrypted in Binary: 11001 Decrypted in Binary: 1110010 Sample execution, where the user provides # and 9: Character to Encrypt: # Key: 9 Original in Binary: 190011 Key in Binary: 111001 Encrypted in Binary: 11010 Decrypted in Binary: 100011 Name your class XORCharacter
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
