@Override
	public String decrypt(String input, String key) throws Exception {
		String output = "";
		SecretKeySpec tempKey = null;
		if (input.length() < 1) {
			return null;
		}
		// 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 default key
			tempKey = defaultKey;
		}
		cypher.init(Cipher.DECRYPT_MODE, tempKey);
		byte[] bytes = SBConvertor.stringToByte(input);
		byte[] bResult = cypher.doFinal(bytes);
		// create string from byte array
		output = new String(bResult);
		return output;
	}