# Usage

If you're just getting started, check out the [tutorial](/tutorial.md) instead.​

```
Usage: kryptor [options] <file>

Arguments:
  file             specify a file/directory path

Options:
  -e|--encrypt     encrypt files/directories
  -d|--decrypt     decrypt files/directories
  -p|--passphrase  specify a passphrase (empty for interactive entry)
  -k|--key         specify or randomly generate a symmetric key or keyfile
  -x|--private     specify your private key (unused or empty for default key)
  -y|--public      specify a public key
  -n|--names       encrypt file/directory names
  -o|--overwrite   overwrite files
  -g|--generate    generate a new key pair
  -r|--recover     recover your public key from your private key
  -m|--modify      change your private key passphrase
  -s|--sign        create a signature
  -c|--comment     add a comment to a signature or new key pair
  -l|--prehash     sign large files by prehashing
  -v|--verify      verify a signature
  -t|--signature   specify a signature file (unused for default name)
  --version        view the program version
  -h|--help        show help information

Examples:
  --encrypt [file]
  --encrypt -p [file]
  --encrypt [-y recipient's public key] [file]
  --decrypt [-y sender's public key] [file]
  --sign [-c comment] [file]
  --verify [-y public key] [file]
```

## Specifying files

When referencing file names/paths that contain spaces, you must surround them with "speech marks":

```bash
$ kryptor -e "GitHub Logo.png"
$ kryptor -e "C:\Users\samuel-lucas6\Downloads\GitHub Logo.png"
```

Files in the same directory as the `kryptor` executable can be specified using a file name:

```bash
$ kryptor -e file.txt
```

However, files that aren't in the same directory must be specified using a file path:

```bash
$ kryptor -e C:\Users\samuel-lucas6\Documents\file.txt
```

Multiple files and/or directories can be specified at once:

```bash
$ kryptor -e file1.txt file2.jpg file3.mp4 Photos Videos
```

## Specifying your private key

You can perform encryption, decryption, and signing with your default private key as follows:

```bash
$ kryptor -e file.txt
$ kryptor -d file.txt.bin
$ kryptor -s file.txt
```

This is the recommended approach, but it means your private keys must be kept in the default folder, which varies depending on your operating system:

* Windows: `%USERPROFILE%/.kryptor`
* Linux: `/home/.kryptor`
* macOS: `/Users/USERNAME/.kryptor`

To specify a private key for `-r|--recover`, `-m|--modify`, or a private key not stored in the default folder, you must use the `-x|--private` option followed by `:[file]` like so:

```bash
$ kryptor -r -x:"C:\Users\samuel-lucas6\Documents\encryption.private"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.kryptor.co.uk/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
