public String encrypt(String inputFileName, String key) throws Exception {
		SecretKeySpec tempKey = null;
		System.out.println("Encrypted File: " + inputFileName);
		FileInputStream inputStream = new FileInputStream(inputFileName);
		// create the output file after encryption add an extension .cheng
		File tmpFile = new File(inputFileName);
		String outFileName = this.saveDir.getAbsolutePath() + "/"
				+ tmpFile.getName() + ".cheng";
		FileOutputStream outputStream = new FileOutputStream(outFileName);
		// if user has put in the key, generate a key by the string that user
		// has put in
		if (key != null) {
			tempKey = this.generateKey(key);
		} else {
			// otherwise use defaultkey initialized before
			tempKey = FileEncryptor.defaultKey;
		}
		cypher.init(Cipher.ENCRYPT_MODE, tempKey);
		// read and write from inputfile to outputfile through a buffer bytes
		// this buff array could be improved by using PureBAOS class, but I
		// haven't fully
		// understand the GZIP mechanism
		// ***********************//
		// get help form Ru Peng student ID: G00307401
		// I was used PureBAOS to create dynamic buffer before,but not work
		// **********************//
		byte[] b = new byte[20480];
		while (inputStream.read(b) > 0) {
			outputStream.write(cypher.doFinal(b));
		}
		inputStream.close();
		outputStream.close();
		System.out.println("To: " + outFileName);
		return outFileName;
	}