Metadata-Version: 2.4
Name: pyobs
Version: 1.1.1
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security :: Cryptography
License-File: LICENSE
Summary: Python script obfuscation tool with Rust-powered encryption
Keywords: obfuscation,encryption,python,rust,security
Author: Tugay Solmaz <tugaysolmaz@gmail.com>, AugeLab Tech. RnD. Inc.
Author-email: Tugay <tugay.solmaz@augelab.de>
License: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/tugay/pyobs

[![Python 3.9](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/downloads/release/python-312/)

## PyObs

Rust based, python script obfuscation tool.

# 🚀🚀🚀🚀🚀🚀🚀 BLAZINGLY FAST 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

## Features

-   🛡️ **Tamper Resistant**: Load function compiled in Rust binary prevents interception
-   ⚡ **High Performance**: Rust-based parallel processing for fast obfuscation
-   🛠️ **Command Line Tool**: Easy-to-use CLI for batch processing
-   📦 **Wheel Installable**: Simple installation via pipScript Obfuscation Tool

## Installation

```bash
pip install pyobs
```

## Quick Start

### Obfuscating a Single File

```bash
pyobs obfuscate script.py -o obfuscated_script.py
```

### Obfuscating a Project

```bash
pyobs obfuscate-project /path/to/project -o /path/to/obfuscated_project
```

### Parallel Processing

Use the `-j` option to specify the number of parallel workers for faster project obfuscation:

```bash
pyobs obfuscate-project /path/to/project -o /path/to/obfuscated_project -j 4
```

### Running Obfuscated Scripts

Obfuscated scripts can be run normally:

```bash
python obfuscated_script.py
```

## How It Works

1. **Original Script**: Your Python code

    ```python
    def hello():
        print("Hello, World!")

    if __name__ == "__main__":
        hello()
    ```

2. **Obfuscated Script**: Encrypted and wrapped

    ```python
    from pyobs import load
    load(b'encrypted_data_here...')
    ```

3. **Runtime**: The `load` function decrypts and executes the original code seamlessly.

## API Usage

```python
from pyobs import obfuscate_string, load

# Obfuscate Python code
original_code = '''
def greet(name):
    return f"Hello, {name}!"

print(greet("World"))
'''

obfuscated_data = obfuscate_string(original_code)
print(f"Obfuscated: {obfuscated_data}")

# Load and execute obfuscated code
load(obfuscated_data)
```

## Command Line Interface

### Available Commands

-   `pyobs obfuscate <file>`: Obfuscate a single Python file
-   `pyobs obfuscate-project <directory>`: Obfuscate an entire Python project
-   `pyobs --help`: Show help information

### Options

-   `-o, --output`: Specify output file or directory
-   `--key`: Custom encryption key (optional)
-   `--recursive`: Process directories recursively
-   `--exclude`: Patterns to exclude from obfuscation
-   `-j, --jobs`: Number of parallel worker threads (for project obfuscation)

## Development

### Prerequisites

-   Python 3.8+
-   Rust 1.70+
-   uv package manager

### Setup Development Environment

```bash
# Clone the repository
git clone https://github.com/tugay/pyobs.git
cd pyobs

# Install development dependencies
uv sync --dev

# Build the Rust extension
maturin develop
```

### Running Tests

```bash
# Run Python tests
uv run pytest

# Run Rust tests
cargo test

# Run with coverage
uv run pytest --cov=pyobs
```

### Building

```bash
# Build wheel
maturin build --release

# Build and install locally
maturin develop --release
```

## Security Considerations

-   PyObs provides obfuscation, not military-grade security
-   The encryption key is embedded in the Python runtime
-   Suitable for protecting intellectual property and deterring casual reverse engineering
-   For high-security applications, consider additional security measures

## Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for a history of changes.

