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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file obscurepy-0.6.0.tar.gz.

File metadata

  • Download URL: obscurepy-0.6.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1+

File hashes

Hashes for obscurepy-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b9333fd374d76f70d741400afcb55b0e22b83a30c74ea9ff112f804758717972
MD5 2abc62c087fe8e8eb2a4a6c1e232bf9f
BLAKE2b-256 af3ae376c9b46bc267cbe1b59945b0d4f8f2389e4d33422fbcfb478bbf1beec0

See more details on using hashes here.

File details

Details for the file obscurepy-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: obscurepy-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1+

File hashes

Hashes for obscurepy-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bcef550eb49e7f156fe94750fcc1f854e47b8918dd50a933fc94cc7cf0cb90e
MD5 7787964a5feb133be7019eda8f176fae
BLAKE2b-256 f0ad8e6dcb1a7dc3b60b9bb13c762e5888d24d64521ff1a767117905a965c752

See more details on using hashes here.

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