@@ -0,0 +1,653 @@
+// Use XOR to encode and decode a message.%0Aclass Encode %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09String msg = %22This is a test%22;%0A%09%09String encmsg = %22%22;%0A%09%09String decmsg = %22%22;%0A%09%09int key = 88;%0A%09%09%0A%09%09System.out.print(%22Original message: %22);%0A%09%09System.out.println(msg);%0A%09%09%0A%09%09// encode the message%0A%09%09for(int i=0; i %3C msg.length(); i++)%0A%09%09%09encmsg = encmsg + (char) (msg.charAt(i) %5E key);%0A%09%09%0A%09%09System.out.print(%22Encoded message: %22);%0A%09%09System.out.println(encmsg);%0A%09%09%0A%09%09// decode the message%0A%09%09for(int i=0; i %3C msg.length(); i++)%0A%09%09%09decmsg = decmsg + (char) (encmsg.charAt(i) %5E key);%0A%09%09%0A%09%09System.out.print(%22Decoded message: %22);%0A%09%09System.out.println(decmsg);%0A%09%7D%0A%7D%0A

Use XOR to encode and decode a message