Here you can find the source of xor(final byte[] input, final byte[] secret)
public static byte[] xor(final byte[] input, final byte[] secret)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] xor(final byte[] input, final byte[] secret) { final byte[] output = new byte[input.length]; if (secret.length == 0) { throw new IllegalArgumentException("Empty security key"); }/* w w w . ja v a 2 s.co m*/ int spos = 0; for (int pos = 0; pos < input.length; ++pos) { output[pos] = (byte) (input[pos] ^ secret[spos]); ++spos; if (spos >= secret.length) { spos = 0; } } return output; } }