Python Forum
How can I use Cython to protect my Python Code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I use Cython to protect my Python Code?
#1
I wrote a software with Python and I would like to share it on internet, but before to do that I want to be sure to protect its source code as much as possible. to reach my goal, I thought to follow these three steps:

1. use Pyminifier to improve the software size and at the same time obfuscate the source code.
2. use Cython to encapsulate my source code in a compiled C program
3. apply a license (I thought to write an EULA license)

I already know how to use Pyminifer, but I don't understand at all as to user Cython correctly. from what I understand on internet, the main goal of Cython is improving the software performances but at the same time it protects the source code too. my question is:

how can I convert my python software in a compiled C software in order to protect its source code? can you give me an example? keep in mind that my software is composed by some custom modules, all of them placed in the same directory of the main script, but if it's needed, I can integrate all of them in the main one.

p.s .:
please, don't reply to me with something like: "forget about it, it's so difficult ..", ".. is it really necessary?", etc .. probably my software is not so complicated for an expert, it just manages networking data and reads/writes excel files. it has a simple and clear GUI too. on internet it's really difficult to find an alternative, and mainly I worked on it by myself for long long time .. so please, respect my idea to protect my work :)
Reply
#2
To create a binary:
https://github.com/cython/cython/wiki/FAQ#id51

To choose between one file or multiple modules
https://github.com/cython/cython/wiki/FAQ#id53

hth
Reply
#3
thank you for sharing info.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I need to add data types to cython conversion python to c Good_AI_User 1 973 Aug-19-2022, 07:52 AM
Last Post: Gribouillis
  unable to load an image with C (Cython) HLD202 0 1,280 Jan-13-2022, 09:16 PM
Last Post: HLD202
  Cython np.where slows down the code Johanoosterwaal 1 1,695 Sep-01-2021, 07:33 AM
Last Post: Johanoosterwaal
  Why does Cython generates bad code for Gentoo? AlekseyPython 1 1,819 Dec-26-2019, 01:57 PM
Last Post: AlekseyPython
  How I can speed up my Cython module? AlekseyPython 0 1,670 Oct-26-2019, 01:23 PM
Last Post: AlekseyPython
  Error in compiling cython extension on Python 3.6.4 on Windows 8 goldenmean 3 5,700 Jun-05-2019, 09:37 PM
Last Post: Larz60+
  cython does not work skorost5 5 4,184 Dec-19-2018, 09:23 AM
Last Post: skorost5
  Help with building Cython modules. jarrod0987 2 3,291 Nov-15-2018, 03:57 AM
Last Post: Larz60+
  Help with Cython in Win 10 jarrod0987 0 2,989 Oct-06-2018, 12:16 PM
Last Post: jarrod0987
  Cython: How to compile to 32bit Windows with MinGW gcc? PythonABC 0 5,531 May-21-2018, 07:36 PM
Last Post: PythonABC

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020