def create_decrypt_key(password): """ Creates the letter substitution key from a given password. :param password: Password to create the key from :return: Dictionary containing sets of letters """ password = letnum.l2n(password) alphakey = {} x = 1 for num in range(1, 26): password.append(num) numkey = rmv_dupe(password) for a in numkey: alphakey.update({letnum.nl[x]: letnum.nl[a]}) x += 1 key = dict(alphakey.items() + letnum.sym.items()) return key
def create_encrypt_key(password): """ Creates a letter substitution dictionary object based on the Viper Encryption Cypher :param password: Password to create the key from :return: Dictionary containing sets of letters """ password = letnum.l2n(password) alphakey = {} x = 1 for num in range(1, 26): password.append(num) numkey = rmv_dupe(password) for a in numkey: alphakey.update({letnum.nl[a]: letnum.nl[x]}) x += 1 key = dict(alphakey.items() + letnum.sym.items()) return key