Metadata-Version: 2.4
Name: lshlhom
Version: 2.0.0
Summary: Encrypt Python files with 11 native C algorithms + ELF binary compilation
Home-page: https://t.me/yy22ff
Author: shlhom
Author-email: adojod1231@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: Arabic
Classifier: Intended Audience :: Developers
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: cython>=3.0; extra == "dev"
Requires-Dist: setuptools>=40.8; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# lshlhom

**Protect Python files with 11 native C algorithms, multi-layer encryption, and ELF binary compilation.**

**حماية ملفات Python بـ 11 خوارزمية C أصلية، تشفير متعدد الطبقات، وبناء ELF Binary.**

[![PyPI version](https://img.shields.io/pypi/v/lshlhom)](https://pypi.org/project/lshlhom/)
[![Python](https://img.shields.io/pypi/pyversions/lshlhom)](https://pypi.org/project/lshlhom/)
[![License](https://img.shields.io/pypi/l/lshlhom)](https://pypi.org/project/lshlhom/)

---

## Why lshlhom?

You wrote a Python tool, but people keep cracking it. They change their system clock, edit the source, monkey-patch your functions, or just copy it to another machine and use it for free.

**lshlhom v2.0.0** solves all of that. It encrypts your Python file with **11 native C algorithms** — not Python tricks. The result is an **ELF binary** wrapped inside a launcher. Nothing readable remains. No `.pyc` to decompile, no bytecode to unmarshal, no strings to grep.

---

## What's new in v2.0.0?

| Layer | Algorithm | What it does |
|-------|-----------|--------------|
| 1 | **SHL-Cipher (JIT)** | Custom 256-bit block cipher with per-run random S-boxes |
| 2 | **Weave Recipes** | 8 multi-stage data transformation recipes |
| 3 | **Vault** | Chunk-scattered storage with randomized decoy bytes |
| 4 | **RK5** | 5-key segmented XOR with per-key state mixing |
| 5 | **Huffman** | Adaptive compression tree |
| 6 | **Base91 / Base64** | Dual-mode encoding (randomly chosen per file) |
| 7 | **AST Transformations** | Variable renaming + flow flattening + string encryption |
| 8 | **Import Hiding** | Library names replaced with random aliases |
| 9 | **lzma Compression** | Stronger than zlib |
| 10 | **SHA-256** | Integrity verification at load time |
| 11 | **ELF Binary** | Cython + GCC compilation to native ARM64/x86_64 |
| 12 | **Guard** | Blocks LD_PRELOAD, LD_AUDIT, TracerPid, Frida, Xposed |
| 13 | **Self-Check** | Verifies structure before running |

Every one of these is written from scratch in C. No borrowed code, no known signatures, no standard attack patterns.

---

## Installation

    pip install lshlhom

No configuration needed. lshlhom will build its native library automatically on first use if a C compiler is available.

---

## Quick Start

    import lshlhom

    lshlhom.tshfer("my_tool.py")
    # produces my_tool_shlhom.py

That is it. Distribute my_tool_shlhom.py freely. It runs on any machine with Python 3.7+ and the same major version you compiled on. Users cannot see the source, cannot modify it, cannot reuse it on another machine if you add device-binding later.

---

## How It Works

    your_tool.py
         |
         v
    +---------------------+
    | 1. AST + Import Hide |
    | 2. Marshal           |
    | 3. lzma compression  |
    | 4. RK5 encryption    |
    | 5. Weave transform   |
    | 6. Vault scattering  |
    | 7. Huffman + Base91  |
    | 8. SHA-256 signature |
    +----------+----------+
               |
               v
    +---------------------+
    | ELF Binary (native) |
    | + launcher          |
    +----------+----------+
               |
               v
    +---------------------+
    | your_tool_shlhom.py |
    +---------------------+

At runtime, the launcher extracts the ELF into a temporary directory, runs it, and deletes it. The ELF itself performs SHA-256 verification, checks for debuggers and injected libraries, decrypts the payload in memory, and executes it — all without touching disk.

---

## API

### tshfer(input_path, output=None, size_kb=800)

Encrypt a Python file.

    import lshlhom

    # Simple usage
    lshlhom.tshfer("script.py")

    # Custom output
    lshlhom.tshfer("script.py", output="protected.py")

    # Larger binary (harder to analyze)
    lshlhom.tshfer("script.py", size_kb=1200)

    # Disable request integrity check
    lshlhom.tshfer("script.py", use_req_check=False)

### protect(...)

Alias for tshfer.

### shl_native module

Direct access to the C layer:

    from lshlhom import shl_native as sn

    sn.is_available()
    sn.cipher_init()
    sn.cipher_encrypt_block(data, key)
    sn.cipher_decrypt_block(data, key)
    sn.sha256(data)
    sn.guard_check()
    sn.rk5_apply(data, seed)
    sn.rk5_reverse(data, seed)
    sn.weave_apply(data, rid, params)
    sn.weave_reverse(data, rid, params)

---

## Requirements

- Python 3.7+
- GCC or Clang for native compilation (optional)
- Cython for ELF binary generation (optional)

The build is automatic on first tshfer() call.

---

## Compatibility

The encrypted file is **tied to the Python version it was compiled on**. If you compile on Python 3.11, it will run on Python 3.11. This is by design — the ELF binary links against libpython3.11.so.

If you want to distribute across versions, run tshfer() on each version you support.

---

## Security

| Attack | Protection |
|--------|-----------|
| Decompiling .pyc | No .pyc — the payload is ELF binary |
| Extracting strings | Strings stored in scattered vault with decoys |
| Editing the file | SHA-256 verification at load time |
| LD_PRELOAD injection | Guard rejects unknown preloads |
| Running under gdb | TracerPid detection |
| Frida / Xposed / QEMU | /proc/self/maps scan |
| Copying cache | Cache bound to keys |
| Monkey-patching | Import hiding + AST transformations |

No protection is 100 percent — but this raises the bar to a level where 99 percent of attackers will walk away.

---

## Support

- Email: adojod1231@gmail.com
- Telegram: @yy22ff

---

## License

MIT (c) shlhom

---

Made in Termux. Built for developers who are tired of losing their work.
