pythonhtmldownloadexesource-code-protection

Python exe - how can I restrict viewing source and byte code?


I'm making a simple project where I will have a downloadable scraper on an HTML website. The scraper is made in Python and is converted to a .exe file for downloading purposes. Inside the python code, however, I included a Google app password to an email account, because the scraper sends an email and I need the server to login with an available Google account. Whilst .exe files are hard to get source code for, I've seen that there are ways to do so, and I'm wondering, how could I make it so that anyone who has downloaded the scraper.exe file cannot see the email login details that I will be using to send them an email when the scraper needs to? If possible, maybe even block them from accessing any of the .exe source code or bytecode altogether? I'm using the Python libraries bs4 and requests.

Additionally, this is off-topic, however, as it is my first time developing a downloadable file, even whilst converting the Python file to a .exe file, my antivirus picked it up as a suspicious file. This is like a 50 line web scraper and obviously doesn't have any malicious code within it. How can I make the code be less suspicious to antivirus programs?


Solution

  • Sadly even today,there is no perfect solution to this problem.

    As for your second question antiviruses and specifically windows don't like programms running without installers and unsigned. You can use inno setup to create a real life program installer. If you want to deal with UAC or other issues related to unsigned programms you can sign your programm(will cost money).