Here you can find the source of xor(byte[] first, byte[] second)
public static byte[] xor(byte[] first, byte[] second) throws Exception
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] xor(byte[] first, byte[] second) throws Exception { if (first.length != second.length) throw new Exception("Arguments have different lengths"); byte[] output = new byte[first.length]; for (int i = 0; i < first.length; i++) { output[i] = (byte) (first[i] ^ second[i]); }/*from w w w .j ava2 s.c om*/ return output; } }