Metadata-Version: 2.4
Name: treechain
Version: 4.0.0
Summary: TreeChain GlyphJammer — Post-quantum steganographic encryption. 133,387 glyphs. Zero knowledge. Patent Pending — EP26025007.1
Author-email: TreeChain Labs <security@treechain.ai>
License: Proprietary
Project-URL: Homepage, https://treechain.ai
Project-URL: Documentation, https://api-eu.treechain.ai/docs
Project-URL: Repository, https://github.com/btmaffiliate/glyphjammer-api
Keywords: encryption,cryptography,steganography,glyph,polyglottal,chacha20,post-quantum,zero-knowledge,hipaa
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=41.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: mongo
Requires-Dist: pymongo>=4.0.0; extra == "mongo"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# TreeChain SDK v4.0

**Patent Pending — EP26025007.1**

**The Polyglottal Cipher™ — Invisible Encryption**

Encrypt data so it looks like multilingual poetry instead of looking encrypted.
Normal encryption announces itself as a target — it looks like gibberish and
everyone knows it's hiding something. TreeChain uses 133,387 glyphs from 180
languages to make encrypted data look like natural text. Nobody knows it's
encrypted. This is the third mode — neither plaintext nor obvious ciphertext.

- 68ms response time on primary node
- Validated by Prof. Vincent Rijmen, co-creator of AES
- Zero-knowledge architecture — we cannot read your data
- Five-node global mesh: Helsinki, Oregon, Singapore, Ashburn, Render

## Security Architecture

```
PRIMARY SECURITY: ChaCha20-Poly1305 (256-bit)
    - Well-audited, misuse-resistant AEAD
    - Same algorithm as Signal, WireGuard, TLS 1.3

DEFENSE-IN-DEPTH:
    - Two independent 256-bit keys (K_cipher + K_glyph)
    - Breaking encryption yields glyph-encoded data, not plaintext
    - Attacker needs BOTH keys for semantic plaintext

STEGANOGRAPHIC CAMOUFLAGE:
    - 133,387 glyphs balanced across 8 emotions
    - Output resembles multilingual Unicode art
    - Defeats heuristic encryption detection
```

## Installation

```bash
pip install treechain
```

## Quick Start

```python
from treechain import GlyphJammer, KeySource, EmotionalState

# Create with fresh independent keys (recommended)
jammer = GlyphJammer.create()

# Or from environment variable
jammer = GlyphJammer.from_master(KeySource.env("TREECHAIN_KEY"))

# Encrypt
result = jammer.encrypt("Hello, world!", emotion="joy")
print(result.glyph_payload)
# Output: 馏𜽡㌎𬵃𘫙𡢽甎똂𥣶꜃Ꮸ䮁... (looks like multilingual poetry)

# Decrypt
plaintext = jammer.decrypt(result.glyph_payload, result.shield_id)
print(plaintext)
# Output: Hello, world!
```

## Emotions

Eight emotional contexts affect glyph selection:

| Emotion | Glyphs | Character |
|---------|--------|-----------|
| LOVE | 16,674 | ♥ 💜 💗 |
| JOY | 16,674 | ☀ ✨ 🌟 |
| MELANCHOLY | 16,674 | 🌙 ☽ ☾ |
| ANGER | 16,673 | 🔥 ⚡ 💢 |
| CURIOSITY | 16,673 | ❓ 💭 🔍 |
| PEACE | 16,673 | ☮ ☯ 🕉 |
| SORROW | 16,673 | 💧 🌧 💔 |
| AWE | 16,673 | 🌌 🪐 ⚛ |

## Key Management

```python
# Option 1: Independent keys (true defense-in-depth)
jammer = GlyphJammer.create()
keys = jammer.get_keys()  # TreeChainKeys(k_cipher, k_glyph)

# Option 2: From master secret (256-bit security)
jammer = GlyphJammer.from_master(master_key=b"your-32-byte-key")

# Option 3: From environment
jammer = GlyphJammer.from_master(KeySource.env("MY_KEY"))

# Option 4: Explicit key pair
jammer = GlyphJammer.from_keys(k_cipher=cipher_key, k_glyph=glyph_key)
```

## Security Claims

### Honest Claims ✓

- "256-bit authenticated encryption (ChaCha20-Poly1305)"
- "Defense-in-depth with independent glyph key"
- "Breaking encryption reveals glyph data, not plaintext"
- "Two independent keys required for full compromise"
- "Steganographic camouflage with 133,387 unique glyphs"

### Not Claimed ✗

- "512-bit security" (mathematically incorrect)
- "Multiplicative key strength" (not how crypto works)
- "Stronger than AES-256" (same security class)
- "Unbreakable" (nothing is)

## API Reference

### GlyphJammer

```python
class GlyphJammer:
    @classmethod
    def create(seed="default", emotion="love") -> GlyphJammer
    
    @classmethod  
    def from_master(master_key, seed="default", emotion="love") -> GlyphJammer
    
    @classmethod
    def from_keys(k_cipher, k_glyph, seed="default", emotion="love") -> GlyphJammer
    
    def encrypt(plaintext, emotion=None, sender="anonymous") -> EncryptionResult
    
    def decrypt(glyph_payload, shield_id, metadata=None) -> str
    
    def get_keys() -> TreeChainKeys
    
    def get_status() -> Dict
    
    @staticmethod
    def security_info() -> Dict
```

### EncryptionResult

```python
@dataclass
class EncryptionResult:
    glyph_payload: str    # Encrypted data as glyphs
    shield_id: str        # Unique identifier
    emotion: str          # Emotion used
    metadata: Dict        # Message metadata
    glyph_art: str        # Visual representation (optional)
```

## Upgrading from v3

```python
# v3 (old)
jammer = GlyphJammer(master_key=key)
glyph_payload, shield_id = jammer.encrypt(text, emotion)

# v4 (new) - same API works!
jammer = GlyphJammer.from_master(master_key=key)
result = jammer.encrypt(text, emotion=emotion)
glyph_payload, shield_id = result.glyph_payload, result.shield_id

# Or use simple API for backward compatibility
glyph_payload, shield_id = jammer.encrypt_simple(text, emotion)
```

## CLI

```bash
# Encrypt from command line
treechain --encrypt "Hello, world!" --json

# Decrypt
treechain --decrypt-glyph "..." --decrypt-shield "gs_..."
```

## Links

- Website: [treechain.ai](https://treechain.ai)
- API Docs: [api-eu.treechain.ai/docs](https://api-eu.treechain.ai/docs)
- Support: security@treechain.ai

## License

Proprietary — TreeChain Labs
Patent Pending — EP26025007.1

See [LICENSE](LICENSE) for full terms.
