Here you can find the source of xor(byte[] b1, byte[] b2)
public static byte[] xor(byte[] b1, byte[] b2)
//package com.java2s; /* This code is part of Freenet. It is distributed under the GNU General * Public License, version 2 (or at your option any later version). See * http://www.gnu.org/ for further details of the GPL. */ public class Main { public static byte[] xor(byte[] b1, byte[] b2) { int maxl = Math.max(b1.length, b2.length); byte[] rv = new byte[maxl]; int minl = Math.min(b1.length, b2.length); for (int i = 0; i < minl; i++) rv[i] = (byte) (b1[i] ^ b2[i]); return rv; }/*from www . ja va 2 s. c o m*/ }