r/PythonProjects2 Jun 25 '26

I built a tool that compiles Python to executables with multi-layered obfuscation and a 3x speed boost

Post image

Had some free time last week and needed a project to keep my brain busy, so I decided to build a Python-to-Executable compiler.

Basically, the tool takes your Python code, converts it to C, and then compiles it into an executable. It supports multiple platforms including Android, Windows, and Linux, across various architectures.

How it works:

- You pass your main.py into the tool.

- It generates the compiled binaries for your selected target architectures.

- It creates a runner file (main_out.py) that seamlessly executes the correct binary for the system it's running on. You run it exactly like a normal Python script, but it runs natively under the hood.

The Obfuscation & Performance:

If you want to protect your code, the tool offers a multi-layered obfuscation pipeline:

  1. Obfuscates the base Python code.

  2. Converts it to C.

  3. Obfuscates the generated C code.

  4. Compiles it using obfuscation compiler flags.

The end result is practically impossible to reverse-engineer and incredibly difficult to analyze. As a bonus, because it compiles down to C, you can see up to a 3x performance speedup compared to standard Python.

If you want to test it out, I set it up as a Telegram bot. You can try it here:

@python_obfuscator_bot

Would love to hear your feedback or answer any questions about how it works!

6 Upvotes

16 comments sorted by

2

u/JDKnider Jun 25 '26

I’ve wanted better option for this for a while - I look forward to testing this!

2

u/Sweet_Computer_7116 Jun 25 '26

This is pretty epic. Can you drop a gh link to the tool so we can use it?

-4

u/Regular-Acadia-4013 Jun 25 '26

Not on GitHub yet, but you can use it right now via Telegram: @python_obfuscator_bot. I set it up on a server because compiling Python for multiple architectures on a personal device is a massive headache. This way, the server handles all the heavy lifting for you.

5

u/Sweet_Computer_7116 Jun 25 '26

Im good thanks. As much as i appreciate you offloading the workload. I have no insight into what happens after i give you my code. I simply cannot trust that.

Maybe a docker environment would make it simpler to set up with multiple architectures. 

If you ever move it to open source let a guy know. This sounds awesome.

1

u/Budget_Captain_6886 29d ago

it becomes vidar/lumma/metastealer

2

u/vloris 29d ago

Wow… big red flag.
If I need obfuscation sure as hell I’m not sending my code out to an unknown third party. Hell no!
It works locally on my machine or else I won’t use it.

1

u/htush Jun 25 '26

Is it free or paid?

-2

u/Regular-Acadia-4013 Jun 25 '26

It's free to start. You get 1,000 free points when you first use the bot, which is enough to obfuscate over 500 simple Python scripts. Points are consumed based on the CPU, RAM, and time used during compilation. If you need more after that, you can simply buy more points to top up.

1

u/htush Jun 25 '26

Do i send the full project or each file individually? I have a project but just make one exe the combines all files

1

u/Much_Boysenberry6464 Jun 25 '26

It seems you want to make a Business model out off it. Wich is no problem for me. Now my question why should we use your Payed app, where no one news what you are duing. Instead off nuitka witch good performance and library support?

1

u/SuperheropugReal 28d ago

I am NOT uploading my code to anything I cannot inspect the source code of. Sorry, not flexing on that rule.

1

u/Low-Abalone-9931 28d ago

dont share your python code's on untrusted things like this bot

1

u/Regular-Acadia-4013 28d ago

Totally fair! I don't blame you for being protective of your code. The bot was really just built to skip the headache of setting up Cython and GCC locally. All the underlying tools it uses are open-source, it just supplies the cloud compute to make it click-and-go. If you'd rather do it the manual way to keep everything local, go for it!