Java Utililty Methods String XOR Encode

List of utility methods to do String XOR Encode

  1. HOME
  2. Java
  3. S
  4. String XOR Encode

Description

The list of methods to do String XOR Encode are organized into topic(s).

Method

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);

AltStyle によって変換されたページ (->オリジナル) /