Chronoxx
Chronoxx

Reputation: 107

remove remaining hex code in Pyc file

I have a project to send, where basically I have to send an email using python.

My code is complete so I was about to send it. Because of the fact the module smtplib needs my email log in, I compiled my code so people could no see my email and password, however, even compiled, when we look at the hex code, we can still see my email and password (and some print)

Is there a way to compile so we have no information left after?

Thank you very much for your help and time !

Upvotes: 0

Views: 131

Answers (1)

Marat
Marat

Reputation: 15738

Generally it is a bad idea to hold sensitive information in the code. There is no uniformly the best way to do it, but common practices to store credentials include:

  • in a separate code file not in your code base (local_settings.py, added to .gitignore)
  • in a separate config file outside of the project (e.g. json or yml)
  • environment variables (read using os.environ)
  • command line parameters
  • request as user input
  • a combination of all above

Upvotes: 1

Related Questions