def make_cipher_menu(self): import config cipher = self.cipher_module cipher_list = [(o.capitalize(), o) for o in cipher.list_engines()] menu = [] menu.append( MenuChoice( "Cipher engine", ("Please choose a cipher engine to crypt passwords " "in the database."), self.cfg["cipher_type"], self.set_cipher, *cipher_list ) ) if self.cfg["cipher_type"] == "blowfish": menu.append( MenuPassword( "Blowfish secret passphrase", "Enter at least 10 characters.", config.get_config["blowfish"]["secret"], self.set_blowfish_secret, ) ) return menu
def make_cipher_menu(self): import config cipher = self.cipher_module cipher_list = [(o.capitalize(), o) for o in cipher.list_engines()] menu = [] menu.append( MenuChoice('Cipher engine', ("Please choose a cipher engine to crypt passwords " "in the database."), self.cfg['cipher_type'], self.set_cipher, *cipher_list)) if self.cfg['cipher_type'] == 'blowfish': menu.append( MenuPassword('Blowfish secret passphrase', "Enter at least 10 characters.", config.get_config['blowfish']['secret'], self.set_blowfish_secret)) return menu
def set_cipher(self, value): import cipher if value not in cipher.list_engines(): return False self.cfg['cipher_type'] = value
def set_cipher(self, value): import cipher if value not in cipher.list_engines(): return False self.cfg["cipher_type"] = value