Java String Encrypt encrypt(String s)

Here you can find the source of encrypt(String s)

Description

encrypt

License

Open Source License

Parameter

Parameter Description
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

Declaration

public static String encrypt(String s) 

Method Source Code

//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;
    }
}

Related

  1. encrypt(char ch)
  2. encrypt(int original, int salt)
  3. encrypt(String data, String key)
  4. encrypt(String inStr)
  5. encrypt(String s)
  6. encrypt(String str)
  7. Encrypt(String str)
  8. Encrypt(String str, String salt)
  9. encrypt(String string)