Here you can find the source of xorBytes(byte[] data, byte[] key)
public static byte[] xorBytes(byte[] data, byte[] key)
//package com.java2s; // under the terms of the GNU Lesser General Public License as published public class Main { /**// w w w .j a va 2 s. c om * XORs a byte array against a key. */ public static byte[] xorBytes(byte[] data, byte[] key) { byte[] xored = new byte[data.length]; for (int ii = 0; ii < data.length; ii++) { xored[ii] = (byte) (data[ii] ^ key[ii % key.length]); } return xored; } }