protected String encode_matrix(String[][] matrix)
	{
		int row=matrix.length;
	//	int col=matrix[0].length;
		int cur_index=1;
		int col_index;
		StringBuilder s=new StringBuilder();
		Integer[] tk=new Integer[this.key.length];
		for(int i=0;i<tk.length;i++)
		{
			tk[i]=Integer.valueOf(this.key[i]);
		}
		while(cur_index<=this.period)
		{
			
			col_index=Arrays.asList(tk).indexOf(cur_index);
			for(int i=0;i<row;i++)
			{
				if(matrix[i][col_index]!=null)
				{
					s.append(matrix[i][col_index]);
				}
			}
			cur_index++;
		}
		return s.toString();
	}