public static void testEncryption(String filename)
	{
		String keyfile=filename.replace(".","_");
		String test="";
		keyfile=keyfile+".key";

		try
		{
			BufferedReader in = new BufferedReader(new FileReader(keyfile));
			test=in.readLine();
		}
		catch(Exception e){e.printStackTrace();}

		if(!test.equals(encrypt(filename)))
		{
			System.out.println("Invalid key.");
			System.exit(-1);
		}
	}