Metadata-Version: 2.1
Name: kawsarxencode
Version: 1.0.1
Summary: 9-Layer unbreakable encoding system by KAWSAR — base64+marshal+XOR+Sbox+shuffle+KAWSARCODEX+KAWSARV1+KAWSAR2+KAWSAR
Author: KAWSAR
Author-email: KAWSAR <kawsar449@proton.me>
License: MIT
Project-URL: Homepage, https://github.com/KAWSAR/kawsarxencode
Project-URL: Repository, https://github.com/KAWSAR/kawsarxencode
Keywords: encoding,cipher,obfuscation,kawsar,marshal,base64,xor,kawsarxencode,python-encoder,secure,multi-layer
Classifier: Programming Language :: Python :: 3
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: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# kawsarxencode

**9-Layer Unbreakable Encoding System** — by KAWSAR

```
pip install kawsarxencode
```

---

## Encoding Layers

| Layer | Name        | Method                                  |
|-------|-------------|------------------------------------------|
| 1     | base64      | Standard binary → text baseline          |
| 2     | marshal     | Bytecode-style binary packing            |
| 3     | XOR         | Dynamic SHA-512 key schedule             |
| 4     | S-box       | 256-byte substitution cipher             |
| 5     | obfuscation | Position shuffle (LCG-based)             |
| 6     | KAWSARCODEX | Custom 2-char symbol map                 |
| 7     | KAWSARV1    | Bitwise rotate-3 + XOR                   |
| 8     | KAWSAR2     | 16-byte block transposition              |
| 9     | KAWSAR      | Custom-alphabet base64 + HMAC-SHA256     |

---

## Quick Start

```python
from kawsarxencode import encode, decode

enc = encode("Hello World", key="MySecret")
dec = decode(enc, key="MySecret").decode()
print(dec)  # Hello World
```

---

## Python File Encoder

Encode any `.py` file so the output contains **only one import**:

```python
from kawsarxencode import encode_python

encode_python("myapp.py", "myapp_encoded.py", key="MySecret")
```

The encoded file looks like this:

```python
import kawsarxencode

kawsarxencode.run_encoded(
    '<encoded_payload>',
    'MySecret',
)
```

Running the encoded file decodes and executes the original code automatically.

To restore the original file:

```python
from kawsarxencode import decode_python

decode_python("myapp_encoded.py", "myapp_restored.py", key="MySecret")
```

---

## CLI Usage

```bash
# Encode text
kawsarxencode encode "Hello World" --key MySecret

# Decode text
kawsarxencode decode "KX..." --key MySecret

# Encode any file
kawsarxencode encode-file myfile.txt myfile.kx --key MySecret

# Decode any file
kawsarxencode decode-file myfile.kx myfile.txt --key MySecret

# Encode a Python file (single-import output)
kawsarxencode encode-py myapp.py myapp_enc.py --key MySecret

# Restore encoded Python file
kawsarxencode decode-py myapp_enc.py restored.py --key MySecret

# Generate a secure random key
kawsarxencode genkey --length 48

# Show layer info
kawsarxencode info
```

---

## API Reference

```python
from kawsarxencode import (
    KawsarXCipher,     # Core cipher class
    encode,            # Encode str/bytes
    decode,            # Decode to bytes
    encode_file,       # Encode any file
    decode_file,       # Decode any file
    encode_python,     # Encode .py file (single-import output)
    decode_python,     # Restore encoded .py file
    run_encoded,       # Runtime executor (used by encoded files)
    generate_key,      # Generate secure key
    verify_integrity,  # Verify encoded string
)
```

---

## License

MIT — Created by KAWSAR
