DEV Community

Cover image for I built an Advanced Python & JS Obfuscator with AI Auto-Decryption πŸ›‘οΈ
Hassan Magdy
Hassan Magdy

Posted on

I built an Advanced Python & JS Obfuscator with AI Auto-Decryption πŸ›‘οΈ

Hey Developers! πŸ‘‹

I'm EuroMoscow, a Full Stack Developer. Recently, I noticed that many online code obfuscators are either paid, outdated, or break the code after encryption (especially with Python versions mismatch).

So, I decided to build my own solution: EuroMoscow Shield πŸ›‘οΈ.

It is a free, mobile-responsive, and powerful tool to protect your Intellectual Property (IP) for both Python and JavaScript projects.

πŸ”— Try it Live: EuroMoscow Shield

πŸ’» Source Code: GitHub Repository


πŸ”₯ Key Features

I wanted to create something robust, so I implemented multiple layers of protection:

🐍 For Python Developers

  • Safe Renaming: Smart AST parsing that renames variables/functions without breaking your logic.
  • Portable Blob: A custom technique I developed to compress code into a zlib integer array (Runs on any Python 3.x version, solving the Marshal version error).
  • EuroMoscow XOR: Custom encryption with dynamic keys.
  • Import Guard: Automatically detects libraries (sys, os, etc.) and protects them from being renamed.

πŸ“œ For JavaScript Developers

  • Hex Encoding: Converts logic to hexadecimal strings (\x68\x65...).
  • Char Code Array: Transforms code into number arrays.
  • URL & Base64 Encoding: Standard web obfuscation layers.

πŸ€– The "AI" Auto-Decryptor

This is my favorite feature. In the Decryptor section, you don't need to select which algorithm was used.
The engine automatically scans the code using RegEx patterns and heuristically detects the layers (Base64 -> Zlib -> XOR -> Blob) to recover the source code instantly!


πŸ“± Mobile Responsive & Cyberpunk UI

I spent a lot of time polishing the UI. It features a dark "Cyberpunk" theme with:

  • CodeMirror integration for syntax highlighting.
  • Client-Side Processing: Files are downloaded directly from the browser (No server size limits!).
  • Fully Responsive: Works perfectly on mobile devices with a custom sidebar layout.

πŸ› οΈ Tech Stack

  • Backend: Python (Flask)
  • Frontend: HTML5, CSS3, JavaScript
  • Deployment: Vercel
  • Libraries: ast, zlib, base64, codemirror

πŸš€ API Access

I also built a public API for developers who want to integrate this protection into their CI/CD pipelines.


python
import requests

url = "[https://euro-moscow-shield.vercel.app/process](https://euro-moscow-shield.vercel.app/process)"

payload = {
    "code": "print('Hello Dev.to')",
    "action": "encrypt",
    "lang": "python",
    "options": ["rename", "marshal", "xor"]
}

response = requests.post(url, json=payload)
print(response.json()['result'])

πŸ™Œ Feedback
I built this project to help the community protect their open-source tools and bots. I would love to hear your feedback, suggestions, or bug reports!

If you find it useful, please give it a Star ⭐ on GitHub!

Happy Coding! πŸ’»
Enter fullscreen mode Exit fullscreen mode

Top comments (0)