def encrypt(key,text,dec=1): if __name__ == '__main__': encrypted = "" key = hasher(key) dupkey = key for i in range(len(text)): new = chr(ord(text[i])+ dec*(dupkey%10)) encrypted = encrypted + new if dupkey==0: dupkey = key dupkey = int(dupkey/10) return encrypted