I want to generate my Python code in a setup.exe. The user stores an email password in the script. My question: Do I have to additionally encrypt this password, even though I create an * .exe file.
def load_settings(self): # print(__file__) # print(os.path.dirname(__file__)) pf = os.path.dirname(__file__) pa = os.path.join(pf, "settings.json") # print(pa) if os.path.exists(pa): # print("Pfad existiert") with open(pa, "r") as infile: data = json.load(infile) self.ein.pfadbez.setText(data["pfad"]) self.ein.name.setText(data["name"]) self.ein.mail.setText(data["mail"]) self.ein.ausgangserver.setText(data["smtp"]) self.ein.port.setText(data["port"]) self.ein.login.setText(data["login"]) self.ein.passwort.setText(data["pw"])
bycrptlibrary to encrypt your password, it is very solid. You might also want to make use ofgetpassinbuilt python library in your code to hide the password from view while it is being entered(typed) by the user. With this whether the password is stored in your code or in a file or database, withbcryptit will be securely hashed