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

Obfuscation of the python code #1

Open
shallyyy opened this issue Jul 27, 2020 · 1 comment
Open

Obfuscation of the python code #1

shallyyy opened this issue Jul 27, 2020 · 1 comment

Comments

@shallyyy
Copy link

"""write content to handin.py file"""

Once you've finished up with creating and modyfing the handin.py file it's probably best to add a layer of obfuscation. Essentially it means to make the code unreadable to users. Python has a built in compiler to byte-code:
python -OO -m py_compile handin.py

This produces a .pyo file that contains byte-code, and where docstrings are removed, etc. You can rename the .pyo file with a .py extension, and handin.py runs like your program but does not contain your source code. This is likely enough to deter any students that get their hands on the handin.py file from figuring out how to break the system.

However this isn't 100% safe, https://github.com/Mysterie/uncompyle2 is a tool that can recover lots of the code and names so this should just be the first safety net.

Could you point me to where the application runs grading?

@naichuan-zhang
Copy link
Owner

def getExecResult(name, sock):

Here is where the grading logic starts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants