public class Translator
{
	private final String ABC = "?abcdefghijklmnopqrstuvwxyz,.<>[]{}'ABCDEFGHIJKLMNOPQRSTUVWXYZ:;()-+=/*%!1234567890 ";
	
	private String sort(String line)
	{
		String temp1 = "";
		String temp2 = "";
		
		for (int i = 0; i < line.length(); i++)
		{
			if (i % 2 == 0)
				temp2 += line.charAt(i);
			else
				temp1 += line.charAt(i);
		}
		
		return temp1 + temp2;
	}
	
	private int charToInt(char c)
	{
		for (int i = 0; i < ABC.length(); i++)
		{
			if (ABC.charAt(i) == c)
				return i;
		}
		
		return -1;
	}
	
	private char intToChar(int a)
	{
		if (a > 0)
			a = a % ABC.length();
		else if (a < 0)
			a = ABC.length() + a;
		
		return ABC.charAt(a);
	}
	
	public boolean validate(String str)
	{
		for (int i = 0; i < str.length(); i++)
		{
			if (charToInt(str.charAt(i)) < 0)
				return false;
		}
		
		return true;
	}
	
	/**
	 * Transforms two chars into one depending on the operator passed.
	 * @param a - first char
	 * @param b - second char
	 * @param operator - arithmetical operator used in transformation
	 * @return combined char
	 */
	
	public char combine(char a, char b, char operator)
	{
		int char1 = charToInt(a);
		int char2 = charToInt(b);
		int result = 0;
		
		switch (operator)
		{
			case '+':
				result = char1 + char2;
				break;
			case '-':
				result = char1 - char2;
				break;
		}
		
		return intToChar(result);
	}
	
	public String getInnerKey(String text, String key)
	{
		String innerKey = "";
		
		int i = 0;
		int j = 2;
		
		int sum = (int)(charToInt(key.charAt(i)) * Math.PI);
		
		while (innerKey.length() < text.length())
		{
			innerKey += intToChar(charToInt(key.charAt(i)) + sum + charToInt(key.charAt(i+1)) * (int)(j+Math.E+0.5));
			
			i++; j++; sum += charToInt(key.charAt(i)) + (int)(Math.PI * j);
			
			if (i == key.length()-1)
				i = 0;
		}
		
		for (int k = 0; k < 5; k ++)
		{
			innerKey = sort(innerKey);
		}
		
		return innerKey;
	}
}

@@ -19,16 +19,103 @@
 lator%0A%7B%0A
+%09/*%0A%09 * the cipher string. If you want to increase supported chars just add here.%0A%09 */%0A
 %09private
@@ -1450,32 +1450,424 @@
 r(result);%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Generates another key which is not seen by the user.%0A%09 * It's this key that's used for encryption/decryption.%0A%09 * However, it can only be generated from the original key.%0A%09 * So if the user entered key isn't the same then you get a different decryption.%0A%09 * @param length - length of the message%0A%09 * @param key - original key that the user entered%0A%09 * @return - generated key%0A%09 */%0A%09%0A
 %09public String g
@@ -1881,19 +1881,18 @@
 Key(
-String text
+int length
 , St
@@ -1966,19 +1966,22 @@
 %09%0A%09%09int 
-sum
+factor
  = (int)
@@ -2054,21 +2054,14 @@
 ) %3C 
-text.
 length
-()
 )%0A%09%09
@@ -2071,28 +2071,18 @@
 %09%09in
-nerKey += intToChar(
+t char1 = 
 char
@@ -2105,17 +2105,25 @@
 (i))
- + sum + 
+;%0A%09%09%09int char2 =%09
 char
@@ -2144,12 +2144,67 @@
 At(i
-+1))
+ + 1));%0A%09%09%09%0A%09%09%09innerKey += intToChar(factor + char1 + char2
  * (
@@ -2213,16 +2213,20 @@
 t)(j
-+
+ + 
 Math.E
-+
+ + 
 0.5)
@@ -2239,49 +2239,23 @@
 %0A%09%09%09
-i++; j++; sum += charToInt(key.charAt(i))
+factor += char1
  + (
@@ -2273,24 +2273,41 @@
 I * j);%0A%09%09%09%0A
+%09%09%09i++; j++;%0A%09%09%09%0A
 %09%09%09if (i == 
@@ -2318,17 +2318,19 @@
 length()
--
+ - 
 1)%0A%09%09%09%09i

Update Translator.java