Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class StreamXORStringKey {
- public static void main(String[] args) {
- String word = "rhubarb";
- int count = 0;
- try {
- byte a;
- while((a = (byte)System.in.read())!= -1){
- System.out.printf("%c", (a ^ word.charAt(count % word.length())));
- count++;
- }
- }
- catch(IOException io){
- io.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment