Here you can find the source of xor(byte[] a, byte[] b)
public static byte[] xor(byte[] a, byte[] b)
//package com.java2s; //License from project: Mozilla Public License public class Main { public static byte[] xor(byte[] a, byte[] b) { if (a.length != b.length) { throw new IllegalArgumentException("Arrays a and b should have equal length"); }//from w w w .jav a2 s. com byte[] result = new byte[a.length]; for (int i = 0; i < a.length; i++) { result[i] = (byte) (a[i] ^ b[i]); } return result; } }