def encrypt(self,inputname,scandir='H',cypherkey="VignereCypher", fname="encrypted.tif"):
		""" This is one of the main functions that a user can use. It inherits some functionality from the Steganography encrypt. The user passes a file and we check if the file is a text file, it just calls the parent class encrypt function and that does the embedding. If it is an image that we need to embed, it converts the grayscale value to a character and then embeds it, the functionality could not be invoked from the parents class as in the initial class, all characters have to have an ascii value under 128 but in this case it can go uptil 255. A file name can be given to store the new image
		Examples: a.encrypt((textfile), a.encrypt(imgf, "V"), a.encrypt(img, "H", ""), a.encrypt(textfile, "V", "SECURITYKEY", "newimg.tif")"""
		try:
			fh = open(inputname)
		except:
			raise ValueError("Source file path provided was wrong.")
		itype = 1
		if(re.search(".txt$", inputname)):
			itype = 2
			try:
				all = fh.readlines()
				new = "".join(all)
			except:
				raise ValueError("Text File doesn not exist")
			message = "msg" + new	
			Steganography.encrypt(self, message, scandir, cypherkey, fname)

		#Checks what file is given
		elif(re.search(".tif$", inputname)):
			if(scandir == 'H'):
				typeofscan = 1
			elif(scandir == 'V'):
				typeofscan = 2
			else:
				raise ValueError("Scan Direction can only be 'H' or 'V', where H is horizontal and V is vertical")
			try:
				inimg = Image.open(inputname)
				inpic = inimg.load()
				imgarr = inimg.size
			except:
				raise ValueError("Image does not exist")
			lensi = 0
			for i in imgarr:
				lensi = lensi + len(str(i))

			init = "$a$a$"
			if not(type(inpic[0,0]) is int):
				raise ValueError("File provided is a color image.")
			message = init + "img"
			newstr = ""
			message = message + str(imgarr)
			for i in range(len(message)):
				newstr = newstr + '{0:08b}'.format(ord(message[i]))
			message = newstr
			grysc = 0
			if(type(self.pic[0,0]) is int):
				grysc = 1
			for y in range(0, imgarr[0]):
				for x in range(0, imgarr[1]):
					new = '{0:08b}'.format(inpic[x,y])
					message = message + new
			#Converts the grayscale value to a character and then to its binary value
			for i in range(len(init)):
				message = message + '{0:08b}'.format(ord(init[i]))
			imgarr = self.img.size
			if(grysc == 1):
				msgsize1 = ((imgarr[0] * imgarr[1] * 1))
			else:
				msgsize1 = ((imgarr[0] * imgarr[1] * 3))
			if(msgsize1 < len(message)):
				raise ValueError("Image can not be embedded as it is too big")
			newstr = message	
			noftimes = len(newstr)
			count = 0
			if(typeofscan == 1):
				for y in range(0, imgarr[1]):
					for x in range(0, imgarr[0]):
						if(count != (noftimes)):
							count = ExtendedStegano._valchange(self,x,y,newstr,grysc,count,noftimes)
						else:
							self.img.save(fname)
							return True
			elif(typeofscan == 2):
				for x in range(0, imgarr[0]):
					for y in range(0,imgarr[1]):
						if(count != (noftimes)):
							count = ExtendedStegano._valchange(self,x,y,newstr,grysc,count, noftimes)
						else:
							self.img.save(fname)
							return True
		else:
			raise ValueError("The file provided isn't one of the acceptable input types.")