0

I want to create some extensions. I created a file called reports.py, and built it with Cython. It produced reports.xxxx.pyd, and I can import it to other python apps. I followed these instructions.

I want to hide the SQL String that appears in the source code from the compiled binary, but it still appears there when I open it in a text editor:

The SQL string in reports.py file that I want to hide: The SQL string in reports.py file that I want to hide

After build with cython, reports.xxx.pyd file: After build with cython, reports.xxx.pyd file

.pyd file opened with notepad: .pyd file opened with notepad

How can I hide the SQL String after building with Cython? Is it possible?

Will Da Silva
  • 6,386
  • 2
  • 27
  • 52
AIRGG
  • 13
  • 4

1 Answers1

1

What you're asking for cannot be done by Cython. Cython is not intended to obfuscate code. Refer to the following post for ideas about how to hide strings that appear in your source code:

How to hide a string in binary code?

Perhaps you could write a C extension module, or a Cython module (with a .pyx extension), and apply some of the techniques from the above post to it.

Will Da Silva
  • 6,386
  • 2
  • 27
  • 52
  • hi, thank you for answer and edited my question now it's look nice, oke now i understand. i want to ensure, maybe there is a way out there that can do it. Thank you.. – AIRGG Aug 19 '21 at 06:07