public static String decrypt(String cipher)
	{
		if(firstTime) {initTabel();firstTime = false;}
		cipher = cipher.toUpperCase();
		
		char[] crypt = cipher.toCharArray();
		String tmp="";
		String plain = "";
		int x,y,pos = 0;
		for(int i=0;i<crypt.length;i+=2)
		{
			//luam doua cate doua
			tmp = crypt[i]+""+crypt[i+1];
			//cautam in matricea de substitutie(vector vazut ca matrice mai exact)
			for(int j=0;j<subst.length;j++)
			{
				if(subst[j].equals(tmp))
				{
					pos = j;
					break;
				}
			}
			//calculam linia si coloana in matrice
			x = pos/27;
			y = pos%27;
			//grupul descifrat
			plain += charAtIndex(x)+""+charAtIndex(y);
		}
		
		return plain;
	}