public static byte[] encrypt(byte[] data, byte[] key) {
		
		byte[] bloc = new byte[16];
		key = paddingKey(key);
		S = generateSubkeys(key);
		

		
		int lenght = 16 - data.length % 16;
		byte[] padding = new byte[lenght];
		padding[0] = (byte) 0x80;
		
		for (int i = 1; i < lenght; i++)
			padding[i] = 0;
		int count = 0;
		byte[] tmp = new byte[data.length+lenght];
		//afiseazaMatrice(S);
		int i;
		for(i=0;i<data.length+lenght;i++){
			if(i>0 && i%16 == 0){
				bloc = encryptBloc(bloc);
				System.arraycopy(bloc, 0, tmp, i-16, bloc.length);
			}
			
			if (i < data.length)
				bloc[i % 16] = data[i];
			else{														
				bloc[i % 16] = padding[count];
				count++;
				if(count>lenght-1) count = 1;
			}
		}
		bloc = encryptBloc(bloc);
		System.arraycopy(bloc, 0, tmp, i - 16, bloc.length);
		return tmp;
	}