标签:
static String simple_xor(String base_data, String encrypt_key) throws UnsupportedEncodingException {
StringBuffer xor = new StringBuffer("");
int base_len = base_data.length();
int encrypt_len = encrypt_key.length();
int j = 0;
for (int i = 0; i < base_len; i++) {
xor.append((char) (base_data.charAt(i) ^ encrypt_key.charAt(j)));
j = (++j) % encrypt_len;
}
return xor.toString();
}
标签:
原文地址:http://www.cnblogs.com/nizuimeiabc1/p/5974081.html