From 23df735ba2f8111c326d030dae3155d18d772f61 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Tue, 20 Oct 2020 15:33:03 +0200 Subject: [PATCH] Updated README file. --- README.md | 29 ++++++++++++++++++++++++++++- frontend/src/main.c | 12 ++---------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8902910..c1324e8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,40 @@ SlunkCrypt ========== -An experimental cryptography library +An experimental cryptography library and command-line tool. + Legal Warning ------------- Use of SlunkCrypt may be illegal in countries where encryption is outlawed. We believe it is legal to use SlunkCrypt in many countries all around the world, but we are not lawyers, and so if in doubt you should seek legal advice before downloading it. You may find useful information at [cryptolaw.org](http://www.cryptolaw.org/), which collects information on cryptography laws in many countries, but we can't vouch for its correctness. + +Command-line Usage +------------------ + +**Synopsis:** + + slunkcrypt --encrypt [[@][:]] + slunkcrypt --decrypt [[@][:]] + +**Commands:** + +- **`--encrypt` (`-e`):** + Encrypt the plaintext in the given input file. The ciphertext is written to the specified output file. +- **`--decrypt` (`-d`):** + Decrypt the ciphertext in the given input file. The plaintext is written to the specified output file. +- **`--self-test` (`-t`):** + Run self-test and exit application. + +**Options:** +- If `` is prefixed with a **`@`** character, then it specifies the file to read the passphrase from. + *Note:* Only the first non-empty line in the specified file is used! +- If `` is prefixed with a **`:`** character, then the leading character is ignored. +- If `` is omitted, then the passphrase is read from the `SLUNK_PASSPHRASE` environment variable. +- If `` is set to **`@-`**, then the passphrase is read from the standard input stream. + + License ------- diff --git a/frontend/src/main.c b/frontend/src/main.c index 2c1a6c6..db9e8f1 100644 --- a/frontend/src/main.c +++ b/frontend/src/main.c @@ -65,17 +65,9 @@ static void print_manpage(const CHR *const program) FPUTS(T("This software has been released under the CC0 1.0 Universal license:\n"), stderr); FPUTS(T("https://creativecommons.org/publicdomain/zero/1.0/legalcode\n"), stderr); FPUTS(T("====================================================================\n\n"), stderr); - FPUTS(T("Synopsis:\n"), stderr); - FPRINTF(stderr, T(" %") T(PRISTR) T(" --encrypt [[@][:]] \n"), program); + FPUTS(T("Usage:\n"), stderr); + FPRINTF(stderr, T(" %") T(PRISTR) T(" --encrypt [[@][:]] \n"), program); FPRINTF(stderr, T(" %") T(PRISTR) T(" --decrypt [[@][:]] \n\n"), program); - FPUTS(T("Options:\n"), stderr); - FPUTS(T("- If is prefixed with a '@' character, then it specifies the file\n"), stderr); - FPUTS(T(" to read the passphrase from; only the first line in that file is used!\n"), stderr); - FPUTS(T("- If is prefixed with a ':' character, then the leading character\n"), stderr); - FPUTS(T(" is skipped and the remainder of the argument is used as passphrase.\n"), stderr); - FPUTS(T("- If argument is omitted, then the passphrase is read from the\n"), stderr); - FPRINTF(stderr, T(" environment variable \"%") T(PRISTR) T("\" instead.\n"), ENVV_PASSWD_NAME); - FPUTS(T("- Specify \"@-\" in order to read the passphrase from the standard input stream!\n\n"), stderr); } static char* read_passphrase(const CHR* const file_name)