# Irene Cipher - Quick Reference Card

## 📦 Installation

```bash
pip install irene-cipher
```

## 🔐 API Reference

### Text Encryption
```python
import irene_cipher

# Encrypt
ciphertext = irene_cipher.encrypt_text("Hello!", "password")
# Returns: bytes

# Decrypt
plaintext = irene_cipher.decrypt_text(ciphertext, "password")
# Returns: str
```

### Binary Encryption
```python
# Encrypt
encrypted = irene_cipher.encrypt_bytes(b"\x00\x01\x02", "password")
# Returns: bytes

# Decrypt
decrypted = irene_cipher.decrypt_bytes(encrypted, "password")
# Returns: bytes
```

### File Encryption
```python
# Encrypt (streaming, any size)
irene_cipher.encrypt_file("in.pdf", "out.pdf.enc", "password")

# Decrypt
irene_cipher.decrypt_file("out.pdf.enc", "in.pdf", "password")
```

### Key Generation
```python
key = irene_cipher.generate_key()
# Returns: bytes (32 bytes)
```

## 🔒 Algorithms

- **Encryption**: XChaCha20-Poly1305 (AEAD)
- **KDF**: Argon2id (64 MiB, 3 iter, 4 lanes)
- **Keys**: 256-bit
- **Nonces**: 192-bit (collision-free)

## 📊 Performance

- Key derivation: ~50ms (intentionally slow)
- Encryption: ~67 MB/s
- Memory (files): ~2 MB constant

## ⚠️ Security

**DO** ✅
- Use strong passwords (16+ chars)
- Handle ValueError exceptions
- Keep library updated
- Store passwords securely

**DON'T** ❌
- Use weak passwords
- Hardcode passwords
- Ignore authentication failures
- Store password with data

## 🔧 Error Handling

```python
try:
    plaintext = irene_cipher.decrypt_text(data, password)
except ValueError:
    # Wrong password or tampered data
    print("Authentication failed")
except RuntimeError as e:
    # Other errors
    print(f"Error: {e}")
```

## 📁 File Format

**Text/Bytes**: `[Salt(16)][Nonce(24)][Ciphertext+Tag]`

**Files**: `[Salt(16)][Nonce(24)][Size(8)][Chunks...]`

## 🏗️ Build from Source

```bash
# Install tools
pip install maturin

# Build
maturin develop --release

# Test
cargo test
python test_irene_cipher.py
```

## 📚 Documentation

- **README.md**: Main docs
- **examples.py**: Code examples
- **FAQ.md**: Common questions
- **BEST_PRACTICES.md**: Usage guide

## 🔗 Resources

- GitHub: github.com/yourusername/irene-cipher
- PyPI: pypi.org/project/irene-cipher
- Docs: See README.md

---

**Version**: 0.1.0 | **License**: MIT | **Python**: 3.8+
