Here you can find the source of xor(byte[] dest, byte[] bytesToMix)
public static void xor(byte[] dest, byte[] bytesToMix)
//package com.java2s; /**/* w w w . jav a 2 s . c o m*/ * Source obtained from crypto-gwt. Apache 2 License. * https://code.google.com/p/crypto-gwt/source/browse/crypto-gwt/src/main/java/com/googlecode/ * cryptogwt/util/ByteArrayUtils.java */ public class Main { public static void xor(byte[] bytes, int offset, byte[] bytesToMix, int mixOffset, int len) { int bytesLength = offset + len; for (; offset < bytesLength; offset++) { bytes[offset] ^= bytesToMix[mixOffset++]; } } public static void xor(byte[] dest, byte[] bytesToMix) { assert dest.length == bytesToMix.length : "different lengths: " + dest.length + " != " + bytesToMix.length; xor(dest, 0, bytesToMix, 0, dest.length); } }