Here you can find the source of encrypt(String s)
Parameter | Description |
---|---|
s | String to be encrypted Each Character of the String is XOR'd with the length of the String |
public static String encrypt(String s)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w. j av a 2 s . c o m * * @param s String to be encrypted * Each Character of the String is XOR'd with the length of the String * @return String with each character XOR'd with length */ public static String encrypt(String s) { String n = ""; int l = s.length(); for (int i = 0; i < l; i++) { char c = s.charAt(i); int t = (int) c; t = t ^ l; c = (char) (t); n += c; } return n; } }