Java has a XOR operator in the form of ^. Just XOR each byte with each subsequent byte and put ... byte ...
stackoverflow.com