Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of packaging app using Cython compiler #407

Open
cztomczak opened this issue Jan 9, 2018 · 1 comment
Open

Example of packaging app using Cython compiler #407

cztomczak opened this issue Jan 9, 2018 · 1 comment

Comments

@cztomczak
Copy link
Owner

cztomczak commented Jan 9, 2018

Cython repo: https://github.com/cython/cython

Packagers like PyInstaller, Py2exe and cx_Freeze can package app into an executable, however they do not provide good security for source codes. Sources when using these packagers are protected by compiling them to bytecode, but that bytecode can be easily converted into original almost complete source codes with only code comments removed. All variables names, functions names, modules, strings, everything can be seen as in original code. PyInstaller provides an additional security by setting a secret cipher that allows to encrypt bytecode compiled code, however this is only security by obscurity and can be easily broken as well.

The only viable options to better protect sources codes are:

  1. Use Cython to compile .py files to .pyd/.so modules (real binaries) and only then package app using e.g. PyInstaller.
  2. Use Nuitka compiler which can both protect sources and also package app into executable (Issue Example of packaging app using Nuitka compiler #396).

See also related issues labeled with: packaging .

@cztomczak
Copy link
Owner Author

cztomczak commented Feb 2, 2018

Cython can also be used to create .exe module. The --embed flag can do that when calling Cython. Cython can also integrate multiple modules. See:

  1. Issue in Cython tracker to simplify compilation of complete applications: Simplify compilation of complete applications cython/cython#2011
  2. Post by Stefan Behnel: https://groups.google.com/d/msg/cython-users/9uQfPteBXMA/P7oSnPkNCAAJ
  3. Cython docs: http://docs.cython.org/en/latest/src/reference/compilation.html#integrating-multiple-modules

@cztomczak cztomczak changed the title Example of compiling app modules using Cython compiler Example of packaging app using Cython compiler Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant