# xoryx

A simple XOR encryption/decryption CLI tool that encrypts files to ASCII hex format.

## Installation

```bash
pip install xoryx
```

For development:

```bash
uv pip install -e .
```

## Usage

### Command Line Mode

**Encrypt a file:**

```bash
xoryx encrypt plaintext.txt encrypted.hex
# Or use short aliases:
xoryx enc plaintext.txt encrypted.hex
xoryx e plaintext.txt encrypted.hex
```

**Decrypt a file:**

```bash
xoryx decrypt encrypted.hex decrypted.txt
# Or use short aliases:
xoryx dec encrypted.hex decrypted.txt
xoryx d encrypted.hex decrypted.txt
```

**Provide key on command line (not recommended for sensitive data):**

```bash
xoryx encrypt plaintext.txt encrypted.hex --key "mysecretkey"
xoryx decrypt encrypted.hex decrypted.txt -k "mysecretkey"
```

If you don't provide a key with `--key` or `-k`, you'll be prompted to enter it securely (hidden input).

### Interactive Mode

Launch the interactive menu by running `xoryx` without arguments:

```bash
xoryx
# Or explicitly:
xoryx interactive
xoryx i
xoryx menu
```

This will present a user-friendly menu where you can choose to encrypt or decrypt files interactively.

### Options

- `-k`, `--key`: Specify the encryption/decryption key (will prompt if not provided)
- `--encoding`: Text encoding (default: utf-8)
- `-h`, `--help`: Show help message

### Examples

```bash
# Encrypt with prompted key
xoryx encrypt secrets.txt secrets.hex

# Decrypt with key on command line
xoryx decrypt secrets.hex restored.txt -k "mypassword"

# Use custom encoding
xoryx encrypt data.txt data.hex --encoding utf-16

# Interactive mode
xoryx
```

## Features

- 🔐 Simple XOR encryption/decryption
- 📝 Outputs to ASCII hex format
- 🎨 Colored terminal output
- 🔒 Secure key input (hidden by default)
- 🎯 Both CLI and interactive modes
- ⚡ Fast and lightweight

## How it works

xoryx uses XOR cipher to encrypt plaintext files. The encrypted output is stored as ASCII hex for easy storage and transmission. While XOR encryption is not suitable for highly sensitive data, it's perfect for quick obfuscation and educational purposes.

## License

MIT
