Skip to main content

Clean-room Python code-protection tool.

Project description

Obfy

PyPI version Python versions License: Source-Available CI Docs

A clean-room Python code-protection tool written in Rust: AST obfuscation plus bytecode encryption with a native loader — and a fully auditable supply chain.

The deliverable is not just "an obfuscator." It is an obfuscator whose entire provenance we can show a customer.

What it does

  • AST obfuscation — --level 0–5: strip docstrings/comments, mangle string literals, inject dead code, rename identifiers (function-local and cross-module), and natively compile eligible functions to a clean-room bytecode VM so their CPython bytecode never ships. The --level flag is the sophistication dial — higher levels do strictly more:

    --level Adds (each level includes the ones below it)
    0 none — compiled, marshalled, encrypted as-is
    1 strip docstrings
    2 + string mangling + dead code
    3 + local (function-scope) rename
    4 + cross-module public-name rename
    5 + native function compilation (CPython bytecode never ships)
  • Bytecode encryption + native loader: compile → marshal → AES-256-GCM encrypt; a PyO3 import hook decrypts in memory at import time. This is the core of the product.

  • Licensing: expiry dates and machine/MAC binding, enforced by the loader.

  • Supply chain: vendored + audited deps, reproducible builds, and an SBOM shipped with every release.

Honest posture — read this

Python obfuscation is deterrence, not encryption-grade security. CPython must eventually execute real bytecode, so a skilled attacker who controls the runtime can recover code objects. Obfy stops casual copying and raises the cost for everyone else; it does not replace legal protection for sensitive IP. More on what each level does and what it does not guarantee: Obfuscation levels — honest posture.

Install

pip install obfy

Requires CPython 3.10–3.13 on macOS (Apple Silicon or Intel), Linux (x86_64 / aarch64), or Windows (x64). Build with the same Python version you ship for — the marshal/bytecode format is version-specific. pip install obfy gives you the obfy CLI and bundles the native runtime that gets packaged into your protected output; there is nothing else to install.

Quick start

Protect a project — one command in, a drop-in replacement out:

obfy build --src ./myproject --out ./dist --python python3

This protects the whole tree — every .py under --src is discovered recursively, obfuscated, compiled, marshalled, and AES-256-GCM encrypted. ./dist is a 1:1 mirror of ./myproject where each .py is a tiny self-activating stub, the real code lives encrypted in ./dist/__obfy__/*.obfy, non-.py files are copied across, and the native runtime is bundled in — nothing extra to install.

Heads-up — secrets: every non-.py file under --src is copied into the dist so the output runs in place. If --src is a repo root, files like .env or keys get copied too. Point --src at your code package (e.g. ./app), or build from a code-only staging tree.

Run it exactly as you ran the original — no sys.path edits, no manual bootstrap:

python ./dist/run.py

See the tutorial for a full walkthrough, and packaging for PyInstaller.

Documentation

Full documentation lives at docs.camouflage.network/obfy:

Building from source

Contributors and anyone building the toolchain themselves (the published wheels already contain everything an end user needs):

# The CLI:
cargo build --release                  # -> target/release/obfy

# The native runtime, into the interpreter you ship for:
pip install maturin
maturin develop --release              # installs obfy_runtime into the active venv

Build the runtime with the same Python version you will run the protected code on. Project provenance, dependency vetting, and the PyArmor comparison live under docs/.

License

Proprietary, source-available — see LICENSE.md. © 2026 Camouflage Networks Inc.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

obfy-0.1.0-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

obfy-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

obfy-0.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.2 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

obfy-0.1.0-cp312-cp312-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12Windows x86-64

obfy-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

obfy-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.2 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

obfy-0.1.0-cp311-cp311-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.11Windows x86-64

obfy-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

obfy-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.2 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

obfy-0.1.0-cp310-cp310-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10Windows x86-64

obfy-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

obfy-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.2 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file obfy-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: obfy-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obfy-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3c8e90fcc41a96094cfbf4e80ded87db602ea751a8bef347f5e8f8d32b0e1f72
MD5 99ef6a45ca0914b10a211c89d485cd5a
BLAKE2b-256 7a54045f7dff10a389dbff897982ee6af4b4908434ab1cf4aa39cbb927da5421

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61362de8eb8a675e7406a3aff076396e9303e61ae7c3ced7f6c4de5519cd76b0
MD5 431d1926e05fac1b6837d52260c8bcf1
BLAKE2b-256 178bf6a0bb5a5af8da6d5e65097116d1a641925378dcdac4d22eee09fc906484

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 54dad89a479487bbb5df104cdfbc7564fa986692fb8e77922a545401e420690f
MD5 1e746a080b4fa9c77aac2cf2db28bca0
BLAKE2b-256 74e825568cc04e63678231c41ef97363652091c72bb116178d5ed1089f6e10c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: obfy-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obfy-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0e21b1bdacaa2da0bfe7ce29cef7aa63f6fbdd9fab3bbf5b1552cd89786f33b8
MD5 5c204211edb1858b01b933fdf4af0aca
BLAKE2b-256 a623a921519ab9d2d7388dc8c25af349fd3c620bc7f0fd9a0f6bd62746c77190

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38012c36757ed7d6407ddc72c5a849c9ca90931b1c534720d0c1d8db498b107d
MD5 04b905d2c6ae66537ade6b7e0beaf6c3
BLAKE2b-256 9c740e89aa108139e6722e45253654b7767dfc9aac35419351c271aff7a8b1ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3018d66f5817d8c6917eb3a77f81b138dd15b4c3b23ed7ad2e2df986b15e948b
MD5 99c535691c498de1af5c16136eb85bdf
BLAKE2b-256 09fd42573a85ab9fa80cc2db794103c590e1e6b2ce323cfdbce15cb68403fe24

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: obfy-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obfy-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9e369ac4e4da4ededa2a74fb3596e78817088b94eee1b2ca1775914232b41844
MD5 a3f5866c0c3af3e89eb67eac4be94d6f
BLAKE2b-256 9099b8a8b2acc01901b054d6815d169bfc9913b7381126481580638c7a0c74f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f98a56274d49e0e5b4f43fee51219523a178216cc24884c2965fef78361e258
MD5 41b48bc890805e7d092b2213c4b73512
BLAKE2b-256 2c888a50b14ff48c7fe7bb68d36f42562f5396650c3af7a85a2caa6c51422c8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 8a0cc123da724534f2428dee53347c0bed4ec4d3e552ab70bf8a92b9747085cc
MD5 1ca2727678be6707f3cdf2787bef6498
BLAKE2b-256 b0387533d181c83d9bfc5aa9e848917e6b2f00bb0f195a4561d9eb6a03e86a0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: obfy-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obfy-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 aa49c00154a14fcaf6d663f40d788e8d38a3c68b2e0e816735ddb887e958bee6
MD5 c55936dc87de9c1729be0a50bc597329
BLAKE2b-256 a603220aa2222f5c5c6cc33c1a46b32055a383ba76f8dee97d9795a4c34637ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 84708fe9f95ba3034b3cefb425f506d2dfcb46a3ed78552668062d564b67eaf1
MD5 660b3e88d60afcdac367e38d4ba3b3f7
BLAKE2b-256 1f5fadcc926f2317ce2b9b680d2f9d2888b131e03d3e00fda93514d9cc760828

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obfy-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for obfy-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 2599a4d07d89f86f077cb34a0ecf683921bf4e50baa6833a2fb11291b5e6ba26
MD5 44f37fdcb084cad4605500537831ccd3
BLAKE2b-256 99cc666ca06541a68db2e0723e9e2f41cb2e0c10211df81d6342e1426af2c87c

See more details on using hashes here.

Provenance

The following attestation bundles were made for obfy-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: workflow.yml on obfy/obfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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