Here you can find the source of xorEncode(String data, String key)
public static String xorEncode(String data, String key)
//package com.java2s; //License from project: Open Source License public class Main { public static String xorEncode(String data, String key) { byte m_cData[] = data.getBytes(); byte m_cKey[] = key.getBytes(); int keyPointer = 0; for (int i = 0; i < m_cData.length; i++) { m_cData[i] ^= m_cKey[keyPointer]; keyPointer += m_cData[i];//from ww w . j av a 2 s . co m keyPointer %= m_cKey.length; } return new String(m_cData); } }