Java String Descrypt decrypt(String string)

Here you can find the source of decrypt(String string)

Description

decrypt

License

Open Source License

Declaration

public static String decrypt(String string) 

Method Source Code

//package com.java2s;
/*//from  ww  w.  j a v a 2s  .com
 * $Id: StringUtilities.java,v 1.6 2004/11/03 17:25:52 edankert Exp $
 *
 * Copyright (C) 2002-2004, Cladonia Ltd. All rights reserved.
 *
 * This software is the proprietary information of Cladonia Ltd.  
 * Use is subject to license terms.
 */

public class Main {
    private static final char[][] table = { { 'a', '3' }, { 'b', 'x' }, { 'c', '0' }, { 'd', 'G' }, { 'e', '4' },
            { 'f', 'D' }, { 'g', '8' }, { 'h', 'w' }, { 'i', 'y' }, { 'j', '2' }, { 'k', 'C' }, { 'l', 'f' },
            { 'm', 'F' }, { 'n', 'j' }, { 'o', 'z' }, { 'p', 'H' }, { 'q', 'b' }, { 'r', 'n' }, { 's', 'M' },
            { 't', 'v' }, { 'u', 'T' }, { 'v', 'B' }, { 'w', 'k' }, { 'x', 'e' }, { 'y', 'U' }, { 'z', '1' },

            { '0', 'O' }, { '1', 'p' }, { '2', 'I' }, { '3', 'r' }, { '4', 'K' }, { '5', 't' }, { '6', 'i' },
            { '7', 'q' }, { '8', 'N' }, { '9', 'P' },

            { 'A', 'V' }, { 'B', '6' }, { 'C', 'Z' }, { 'D', 'c' }, { 'E', 'd' }, { 'F', 'h' }, { 'G', 'E' },
            { 'H', 'o' }, { 'I', 'g' }, { 'J', 'l' }, { 'K', '5' }, { 'L', 'a' }, { 'M', 'm' }, { 'N', 'W' },
            { 'O', 'J' }, { 'P', 'Y' }, { 'Q', 'X' }, { 'R', 'R' }, { 'S', 'L' }, { 'T', 'u' }, { 'U', '9' },
            { 'V', 's' }, { 'W', 'A' }, { 'X', '7' }, { 'Y', 'Q' }, { 'Z', 'S' } };

    public static String decrypt(String string) {
        char[] chars = string.toCharArray();

        for (int i = 0; i < chars.length; i++) {
            chars[i] = decrypt(chars[i]);
        }

        String result = new String(chars);

        //      System.out.println( "StringUtilities.decrypt( "+string+") ["+result+"]");
        return result;
    }

    private static char decrypt(char ch) {
        for (int i = 0; i < table.length; i++) {
            if (table[i][1] == ch) {
                return table[i][0];
            }
        }

        return ch;
    }
}

Related

  1. decrypt(String src)
  2. decrypt(String str)
  3. decrypt(String str)
  4. decrypt(String str)
  5. Decrypt(String str)
  6. decrypt(String string)
  7. decrypt2(byte[] arg0, int arg1, String arg2, byte arg3)
  8. decryptBytes(final byte[] b, final int i)
  9. decryptChar(String pwd, int offset, int pos)