List of utility methods to do String XOR Encode
String | xorEncode(String data, String key) xor Encode 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]; keyPointer %= m_cKey.length; return new String(m_cData); |
String | XORencode(String res, String key) XO Rencode byte[] bs = res.getBytes(); for (int i = 0; i < bs.length; i++) { bs[i] = (byte) ((bs[i]) ^ key.hashCode()); return parseByte2HexStr(bs); |