> ## Documentation Index
> Fetch the complete documentation index at: https://hayate.shiina.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart: Transfer Encrypted Files Across Your LAN

> Send your first encrypted file across your LAN with Hayate using Pairing Mode. Learn both transfer modes and discover peers on your network.

In this guide you'll send an encrypted file from one machine to another on your local network using Hayate's Pairing Mode. You don't need to know any IP addresses — both machines find each other automatically via mDNS and UDP broadcast. By the end you'll have completed a full transfer, verified the checksum, and learned how to use Direct Mode when you already know the receiver's address.

## Send Your First File with Pairing Mode

Pairing Mode is the fastest way to get started. The receiver waits for a sender that knows the matching four-word code; Hayate handles discovery and connection automatically.

<Steps>
  <Step title="Install Hayate on both machines">
    Make sure Hayate is installed on both the sending and receiving machines before you begin. See the [Installation guide](/installation) for one-liners for macOS, Linux, Windows, and Android.
  </Step>

  <Step title="Start the receiver">
    On the machine that will receive the file, run:

    ```bash theme={null}
    hayate receive --code "apple-bravo-charlie-delta"
    ```

    The receiver binds a QUIC listener and begins advertising itself on the LAN via mDNS and UDP broadcast. It will wait until a sender with the matching code phrase connects — no IP address or port number needed.
  </Step>

  <Step title="Send the file">
    On the sending machine, run:

    ```bash theme={null}
    hayate send ./photo.jpg --code "apple-bravo-charlie-delta"
    ```

    Hayate discovers the receiver automatically, performs an ephemeral X25519 key exchange using the code phrase as a salt, and streams the encrypted file over QUIC.

    <Tip>
      Prefer to let Hayate pick the code? Run `hayate send ./photo.jpg` without `--code` and Hayate prints a randomly generated four-word phrase. Share that phrase with the receiver, who then runs `hayate receive --code "word-word-word-word"` to connect.
    </Tip>
  </Step>

  <Step title="Confirm the transfer">
    Both terminals display a live progress bar during the transfer. When it completes, each side prints the file checksum (Blake3 by default) so you can confirm the file arrived intact:

    ```text theme={null}
    ✓ Received photo.jpg (3.2 MB) — blake3: 4e2a1f...
    ```

    If the checksums match on both sides, the transfer succeeded.
  </Step>
</Steps>

## Direct Mode

When you already know the receiver's IP address — or when your network restricts multicast traffic — use Direct Mode instead. The receiver binds a port and you connect to it by address.

```bash theme={null}
# Receiver — binds on port 50001 and prints its address
hayate receive --port 50001

# Sender — connects directly to the receiver
hayate send ./archive.tar.gz 192.168.1.50:50001
```

Direct Mode skips mDNS discovery entirely and connects straight to the address you provide. The encryption handshake still happens — the session is protected by the same ephemeral X25519 key exchange — but without a passphrase, security relies on network locality rather than a shared secret.

## Discover Peers

To see which Hayate receivers are currently listening on your network, run:

```bash theme={null}
hayate discover
```

Hayate scans all detected subnets and streams results live as it finds them. By default the scan runs for 15 seconds. You can shorten the timeout or specify a subnet manually:

```bash theme={null}
# Set a 5-second timeout
hayate discover --timeout 5

# Scan a specific subnet
hayate discover --cidr 192.168.1.0/24
```

Use `discover` any time you want to find an active receiver without remembering its IP address, then copy the address into a `send` command.

## Next Steps

<CardGroup cols={2}>
  <Card title="Send Files" icon="file-arrow-up" href="/guides/send-files">
    Explore all the options for sending files and directories, including compression and integrity settings.
  </Card>

  <Card title="Receive Files" icon="file-arrow-down" href="/guides/receive-files">
    Learn how to configure the receiver, set output directories, and use auto-accept mode.
  </Card>
</CardGroup>
