Skip to content

Commit 6e0d775

Browse files
committed
Fix: Usage message and README.md updated with the -K option
1 parent 07fa6ca commit 6e0d775

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,38 @@ will not install it anywhere. So no root is required.
4141
## Usage:
4242

4343
```
44-
tea [-e |-d [-N] ] [-D] [-v] -k '16 byte key' -I <...>
44+
tea [-e |-d [-N] ] [-D] [-v] [-k '16 byte key'|-K] -I <...>
4545
-e - Encrypt
46-
Encrypts the input files and the output files of each will be placed in the
46+
Encrypts the input files and the output files of each will be placed in the same directory with extension .3
4747
-d - Decrypt
48-
Decrypts the input files and the output files of each will be placed in the
48+
Decrypts the input files and the output files of each will be placed in the same directory excluding extension .3
4949
-N - When decrypting, display output to stdout.
5050
-D - Deletes source files after encryption or decryption.
5151
-v - Verbose
52-
-k - 16 byte key.
52+
-k - 16 byte key (as argument).
53+
-K - 16 byte key (from stdin).
5354
-I - Files that need to be processed.
5455
5556
Notes:
5657
- Cannot use -D (Delete file), -N (stdout output) together.
5758
- Cannot use -e (encryption), -N (stdout output) together.
5859
- When using -N (stdout output), -v (Verbose) is ignored.
60+
5961
```
6062

6163
## Example:
6264

6365
```
64-
tea -ek 'great elephant i' -I secret1 secret2 secret3
66+
$ tea -ek 'great elephant i' -I secret1 secret2 secret3
67+
```
68+
69+
**or**
70+
71+
72+
```
73+
# With the new -K option
74+
$ tea -eK -I secret1 secret2 secret3
75+
Enter key (16 characters): great elephant i
6576
```
6677

6778
This encrypts the files `secret1, secret2, secret3` using the key
@@ -70,9 +81,17 @@ This encrypts the files `secret1, secret2, secret3` using the key
7081

7182

7283
```
73-
tea -dk 'great elephant i' -I password.3
84+
$ tea -dk 'great elephant i' -I password.3
7485
```
86+
87+
**or**
88+
89+
```
90+
# With the new -K option
91+
$ tea -dK -I password.3
92+
Enter key (16 characters): great elephant i
93+
```
94+
7595
This decrypts the file `password.3` using the key `great elephant i`, and
7696
writes the output to `password` file.
7797

78-

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define USAGE(p) fprintf(stderr, \
2525
"Tiny Encryption Algorithm implementation, with 128 bit key.\n" \
2626
"Performs Encryption/Decruption of multiple flies.\n" \
27-
"usage:\n%s [-e |-d [-N] ] [-D] [-v] -k '16 byte key' -I <...>\n" \
27+
"usage:\n%s [-e |-d [-N] ] [-D] [-v] [-k '16 byte key'|-K] -I <...>\n" \
2828
"-e - Encrypt\n" \
2929
" Encrypts the input files and the output files of each" \
3030
" will be placed in the same directory with extension .3\n" \

0 commit comments

Comments
 (0)