Question: i dont want a code written purely in C i need a code written in JAVA help me please!!! This Program is written purely in

i dont want a code written purely in C
i need a code written in JAVA
help me please!!!
This Program is written purely in Java!
 i dont want a code written purely in C i need
a code written in JAVA help me please!!! This Program is written
instructions
purely in Java! instructions A code in JAVA! thats all im asking
A code in JAVA! thats all im asking

import java.util.Scanner; import java.security SecureRandom; import java.math.Biglnteger; class XOR public static void main (String args) try f //Read a line from keyboard Scanner in new Scanner(System.in)://define scanner for input String messageString: System.out.printin("Please enter the message:"l; messageString-in.nextline)://read a line System.out.printin("Original Message: "+ messageString): Biginteger message convertStringToBigintegerlmessageString): //Set up a secure random number generator SecureRandom random SecureRandomgetlnstanceCHAPRNG"); int seed 10; random.setseed(seed); //initilize the random number generator //Generate Key (Warning! botched) byte I keyStream new byte[2) random.nextBytes(keyStream)://generate random bytes in put in keyStream Biginteger key new Biginteger(keyStream) /IXOR encryption - Sender's (Alice's) end Biginteger cipherText message.xor(key): //Convert ciphertext to a string so that we can print it System.out.println("plaintext (in binary):"+ message.toString(2)://displays message in binary System.out.printin("key (in binary):" + key.toString(2): //displays key in binary System.out.println("ciphertext (in binary):" + cipherText.toString(2)): //displays ciphertext in binary System.out.printin("Ciphertext (in characters): "+ convertBigintegerToString(cipherText)): //XOR decryption Receiver's end (Bob's end Biginteger receivedMessage cipherText.xor(keyl String receivedMessageString convertBigintegerToString(receivedMessage); System.out.printin( Received Message: "+ receivedMessageString); catch (Exception e) e.printStackTrace): //This is a method to convert a String to Biginteger by //packing each character of the String into a Biginteger //Input: String //Return Value: Biginteger public static Biginteger convertStringToBiginteger(String s) Biginteger b new Bigintegerfo") for (int i 0; i

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!