ddidderr f72f9034f3 feat(cli): default to interactive passphrase when no key source given
Previously, invoking fcry without any of --raw-key, --passphrase, or
--passphrase-env produced a hard error ("must provide one of ..."). The
common, secure case (interactive TTY passphrase) thus required an
explicit flag, while the dangerous case (--raw-key on the command line)
was equally accessible.

Make the secure path the default: if no key source is specified, fall
back to PassphraseSource::Tty, which prompts on the terminal and runs
argon2id on encrypt. Explicit --passphrase still works and is now
redundant for the default invocation; --raw-key and --passphrase-env
remain unchanged and still suppress the default.

The previous "must provide one of ..." error path becomes unreachable
and is removed: the only way pw_src is None is when raw_key_str is Some,
which is handled by the existing encrypt/decrypt branches.

User-visible change: `fcry -i foo -o foo.enc` now prompts for a
passphrase instead of erroring out. Scripts that relied on the error to
detect missing arguments will instead block on a TTY read; non-TTY
callers should continue to pass --passphrase-env or --raw-key
explicitly.

Test Plan:
- `fcry -i plain -o plain.enc` prompts twice (passphrase + confirm),
  then `fcry -d -i plain.enc -o plain.out` prompts once and round-trips.
- `fcry --raw-key $(head -c32 /dev/urandom | base64) ...` still works
  and does not prompt.
- `PW=hunter2 fcry --passphrase-env PW ...` still works and does not
  prompt.
- `fcry --passphrase --raw-key ...` still rejected by clap
  (conflicts_with_all).
2026-05-02 19:52:19 +02:00
2026-05-02 19:16:50 +02:00
2026-05-02 19:16:50 +02:00

fcry - [f]ile[cry]pt

A file en-/decryption tool for easy use.

Currently fcry uses ChaCha20Poly1305 (RFC 8439) as AEAD cipher provided by the chacha20poly1305 crate.

Status

Currently fcry is not thoroughly tested and in early stages of development.
There is a chance, that something is broken as of now.
Encryption seems to work, but due to a possible lack of understanding of some underlying methods (or misinterpretation) it could theoretically be not effective at all.

See TODO.md for further information.

S
Description
fcry - [f]ile[cry]pt: A file en-/decryption tool for easy use.
Readme 251 KiB
Languages
Rust 100%