Skip to main content

A tool for obscuring, or making python source difficult to read.

Project description

obscurepy

Build Status codecov

Description

A tool for obscuring, or making python source code difficult to read.

Table of Contents

  1. Installation
  2. Limitations
  3. Usage
  4. License

Installation

This command will install obscurepy:

python -m pip install obscurepy

I would recommend installing it in a virtual environment as opposed to globally:

python -m venv venv
source venv/bin/activate
python -m pip install obscurepy

Limitations

As this program is still in active development, there are many limitations. Below is a list of things obscurepy can and can't do, along with an example.

Things that obscurepy can currently do:

  • Obscure class definitions (without bases)
  • Obscure class calls (without arguments)
  • Obscure function definitions (without parameters)
  • Obscure function calls (without arguments)
  • Obscure string constants
  • Obscure integer constants
  • Obscure float constants

Things it cannot do:

  • Anything else

An example:

class FirstClass:
    pass


class SecondClass:
    # this is a comment
    pass


def first_function():
    c = 42


def second_function():
    d = 'string'

def third_function():
    e = 100.0

a = FirstClass()

b = SecondClass()

first_function()

second_function()

third_function()

a = SecondClass()
class _0x3ff:
    pass

class _0x454:
    pass

def _0x5ee():
    _0x63 = int('0x2a', 16)

def _0x643():
    _0x65 = ''.join([chr(x) for x in [115, 116, 114, 105, 110, 103]])

def _0x5e3():
    _0x67 = float.fromhex('0x1.9000000000000p+6')
_0x64 = _0x3ff()
_0x66 = _0x454()
_0x5ee()
_0x643()
_0x5e3()
_0x64 = _0x454()

Usage

The following command can be used to obscure a single file:

obscure --filepath=my_module.py

The following command can be used to obscure a multi file project:

obscure -p --project_dir=my_project

Alternatively, you can specify an output directory for both single file and multi file obscuring:

obscure --filepath=my_module.py --output_dir=desired_output_directory
obscure --project_dir=my_project --output_dir=desired_output_directory

License

MIT License

Copyright (c) 2021 Andrew Christiansen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obscurepy-0.6.0.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

obscurepy-0.6.0-py3-none-any.whl (26.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page