15
15
16
16
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
17
17
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
18
+
18
19
** Table of Contents**
19
20
20
21
- [ Description] ( #description )
@@ -116,44 +117,79 @@ Usage:
116
117
117
118
### Rules
118
119
120
+ ** dotenv-file vs env variables**
121
+
122
+ The program works with given arguments and/or given dotenv-file.
123
+
124
+ - if an entry is not defined (dotenv-file, environment variable, argument), the program exit with failure
125
+ - a given argument overwrites a dotenv-file entry
126
+ - if a given dotenv-file entry is missing, the program looks for the related environment variable
127
+
128
+ ``` mermaid
129
+ flowchart TD;
130
+ A["Variable"]-. "is defined in dotenv-file" .->B[["set environment variable"]]
131
+ B-- "is empty" -->E("EXIT")
132
+ B-- "not empty and valid" -->P[["encrypt or decrypt file"]]
133
+
134
+ A["Variable"]-. "is not defined in dotenv-file" .->C[["get environment variable"]]
135
+ C-- "is empty" -->E("EXIT")
136
+ C-- "not empty and valid" -->P[["encrypt or decrypt file"]]
137
+ ```
138
+
139
+ ** encryption or decryption**
140
+
119
141
- if sourcefile given without a targetfile and sourcefile has not extension ` .aes ` , the targetfile will be encrypted as ` <samePath>/<sourcefile>.aes `
120
142
- if sourcefile has extension ` .aes ` without a targetfile, the targetfile will be decrypted ` <samePath>/<sourcefile> ` (without extension ` .aes ` )
121
143
122
144
``` mermaid
123
145
flowchart TD;
124
146
A["path/to/sourcefile"]-. "has not .aes" .->B[[encrypt sourcefile]]
125
- B-- "has --target" -->C[[ "new/path/to/sourcefile.aes"] ]
126
- B-- "has no --target" -->D[[ "path/to/sourcefile.aes"] ]
147
+ B-- "has --target" -->C["new/path/to/sourcefile.aes"]
148
+ B-- "has no --target" -->D["path/to/sourcefile.aes"]
127
149
128
150
A["path/to/sourcefile"]-. "has .aes" .->F[["decrypt sourcefile"]]
129
- F-- "has --target" -->G[[ "new/path/to/sourcefile"] ]
130
- F-- "has no --target" -->H[[ "path/to/sourcefile"] ]
151
+ F-- "has --target" -->G["new/path/to/sourcefile"]
152
+ F-- "has no --target" -->H["path/to/sourcefile"]
131
153
```
132
154
133
155
## Encryption
134
156
157
+ > \[ !WARNING]
158
+ > don't loose your password. Decryption/Recovery without valid password is impossible!
159
+
135
160
### Linux
136
161
137
- ``` cli
138
- ./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx
162
+ ** encrypt**
139
163
140
- cli app to encrypt and decrypt a given file
141
- Usage:
142
- qt-cli_file_encryption-decryption [OPTION...]
164
+ Encrypt ` /path/to/sourcefile.xlsx ` to ` /path/to/sourcefile.xlsx.aes ` with environment password-variable ` my_secret_var `
143
165
144
- -s, --source arg <path/to/sourcefile> to en-/de-crypt. Mandatory: -s | -d
145
- -t, --target arg target <path/to/outputfile>. Optional: -t | -d
146
- -p, --pwd arg name of password env variable. Mandatory: -p | -d
147
- -d, --dotenv arg <path/to/dotenv> file. Mandatory: -s | -p | -d
148
- -h, --help Print help
166
+ ``` cli
167
+ ./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx --pwd my_secret_var
149
168
```
150
169
151
- > \[ !WARNING]
152
- > don't loose your password. Decryption/Recovery without valid password is impossible!
170
+ Encrypt ` /path/to/sourcefile.xlsx ` to ` /new/path/to/targetfile.xlsx.aes ` with dotenv-file (` PWD=$my_secret_var ` )
171
+
172
+ ``` cli
173
+ ./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx --target /new/path/to/targetfile.xlsx --dotenv /my/configpath/.file_enc-dec
174
+ ```
153
175
154
176
## Decryption
155
177
156
- _ under construction_
178
+ ### Linux
179
+
180
+ ** decrypt**
181
+
182
+ Decrypt ` /path/to/sourcefile.xlsx.aes ` to ` /path/to/sourcefile.xlsx `
183
+
184
+ ``` cli
185
+ ./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx.aes
186
+ ```
187
+
188
+ Decrypt ` /path/to/sourcefile.xlsx.aes ` to ` /new/path/to/targetfile.xlsx `
189
+
190
+ ``` cli
191
+ ./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx.aes --target /new/path/to/targetfile.xlsx
192
+ ```
157
193
158
194
## configuration: dotenv or env
159
195
@@ -162,7 +198,7 @@ Example dotenv file `.env`
162
198
``` dotenv
163
199
SOURCE_FILE=/inpath/to/file.xlsx # Mandatory or mandatory via argument --source
164
200
TARGET_FILE=/outpath/to/file.xlsx # Optional or optional via argument --target
165
- PWD=my_env_secret # Mandatory get password from $my_env_secret or mandatory via --pwd
201
+ PWD=my_env_secret # Mandatory get password from $my_env_secret or mandatory via --pwd my_env_secret
166
202
```
167
203
168
204
Example pwd environmwent variable
@@ -258,6 +294,7 @@ An utility to load environment variables from a .env file
258
294
## folder structure
259
295
260
296
<!-- readme-tree start -->
297
+
261
298
```
262
299
.
263
300
├── .github
@@ -306,6 +343,7 @@ An utility to load environment variables from a .env file
306
343
307
344
10 directories, 34 files
308
345
```
346
+
309
347
<!-- readme-tree end -->
310
348
311
349
<p align =" right " >(<a href =" #top " >back to top</a >)</p >
0 commit comments