Skip to content

Commit b87a369

Browse files
committed
v0.2.0
1 parent 0f44313 commit b87a369

File tree

7 files changed

+519
-32
lines changed

7 files changed

+519
-32
lines changed

README.md

Lines changed: 85 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div id="top" align="center">
2-
<h1>qt-cli_file_encryption-decryption</h1>
2+
<h1>file encryption/decryption</h1>
33

4-
<h4>File encryption and decryption, shell/commandline</h4>
4+
<h4>File encryption and decryption (shell/commandline)</h4>
55
<h6>for Linux, MacOS, Windows</h6>
66

77
[Report Issue](https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption/issues) [Request Feature](https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption/pulls)
@@ -55,11 +55,20 @@ Qt6 C++23 shell/commandline application to encrypt / decrypt the given file.
5555
- Password: SHA256, between 5 to 32 characters
5656
- initialization vector: MD5
5757

58-
See folder `docs/img` for screenshots.
59-
6058
## Features
6159

60+
- [x] encrypt/decrypt every readable file (binary-mode, chunk size 4MB)
6261
- [ ] i18n
62+
63+
- [x] runs on DOS/Windows (shell/commandline)
64+
- [x] runs on MacOS (cli)
65+
- [x] runs on Linux (cli)
66+
- [ ] runs on iOS
67+
- [ ] runs on Android
68+
- [ ] runs on HarmonyOS
69+
- [ ] supports pipe operator or arguments
70+
- [x] supports arguments and dotenv file
71+
6372
- [x] OSS and license
6473
- [x] works as designed
6574
- [ ] no bugs
@@ -70,15 +79,6 @@ See folder `docs/img` for screenshots.
7079
- [x] Installation routine (no Adminstrator rights needed)
7180
- [ ] portable application
7281

73-
- [x] runs on DOS/Windows
74-
- [x] runs on MacOS
75-
- [x] runs on Linux
76-
- [ ] runs on iOS
77-
- [ ] runs on Android
78-
- [ ] runs on HarmonyOS
79-
80-
- [x] supports pipe operator or arguments
81-
8282
<p align="right">(<a href="#top">back to top</a>)</p>
8383

8484
# Status
@@ -94,9 +94,55 @@ See folder `docs/img` for screenshots.
9494

9595
# Documentation
9696

97+
## Usage
98+
99+
```cli
100+
file_encryption-decryption-x86_64 -h
101+
102+
cli app to encrypt and decrypt a given file
103+
Usage:
104+
qt-cli_file_encryption-decryption [OPTION...]
105+
106+
-s, --source arg <path/to/sourcefile> to en-/de-crypt. Mandatory: -s | -d
107+
-t, --target arg target <path/to/outputfile>. Optional: -t | -d
108+
-p, --pwd arg name of password env variable. Mandatory: -p | -d
109+
-d, --dotenv arg <path/to/dotenv> file. Mandatory: -s | -p | -d
110+
-h, --help Print help
111+
```
112+
113+
### Rules
114+
115+
- if sourcefile given without a targetfile and sourcefile has not extension `.aes`, the targetfile will be encrypted as `<samePath>/<sourcefile>.aes`
116+
- if sourcefile has extension `.aes` without a targetfile, the targetfile will be decrypted `<samePath>/<sourcefile>` (without extension `.aes`)
117+
118+
```mermaid
119+
flowchart TD;
120+
A[<pathto/sourcefile>.aes]-. is_encrypted .->B[[encrypt sourcefile]]
121+
B-- has_targetfile -->C[[<new/pathto/sourcefile>.aes]]
122+
B-- no_targetfile -->C[[<pathto/sourcefile>.aes]]
123+
124+
A[<pathto/sourcefile>]-. not_encrypted .->B[[decrypt sourcefile]]
125+
B-- has_targetfile -->C[[<new/pathto/sourcefile>]]
126+
B-- no_targetfile -->C[[<pathto/sourcefile>]]
127+
```
128+
97129
## Encryption
98130

99-
_under construction_
131+
### Linux
132+
133+
```cli
134+
./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx
135+
136+
cli app to encrypt and decrypt a given file
137+
Usage:
138+
qt-cli_file_encryption-decryption [OPTION...]
139+
140+
-s, --source arg <path/to/sourcefile> to en-/de-crypt. Mandatory: -s | -d
141+
-t, --target arg target <path/to/outputfile>. Optional: -t | -d
142+
-p, --pwd arg name of password env variable. Mandatory: -p | -d
143+
-d, --dotenv arg <path/to/dotenv> file. Mandatory: -s | -p | -d
144+
-h, --help Print help
145+
```
100146

101147
> \[!WARNING]
102148
> don't loose your password. Decryption/Recovery without valid password is impossible!
@@ -105,6 +151,22 @@ _under construction_
105151

106152
_under construction_
107153

154+
## configuration: dotenv or env
155+
156+
Example dotenv file `.env`
157+
158+
```dotenv
159+
SOURCE_FILE=/inpath/to/file.xlsx # Mandatory or mandatory via argument --source
160+
TARGET_FILE=/outpath/to/file.xlsx # Optional or optional via argument --target
161+
PWD=my_env_secret # Mandatory get password from $my_env_secret or mandatory via --pwd
162+
```
163+
164+
Example pwd environmwent variable
165+
166+
```cli
167+
export PWD="top_secret_password"
168+
```
169+
108170
## Test / Performance
109171

110172
**tested on**
@@ -177,9 +239,16 @@ The Qt framework contains a comprehensive set of highly intuitive and modularize
177239

178240
Small and portable AES encryption class for Qt. Native support for all key sizes - 128/192/256 bits - ECB, CBC, CFB and OFB modes for all key sizes partial AES-NI support
179241

180-
[![Matt Bricke](https://img.shields.io/badge/Github-bricke-black?logo=github)](https://github.com/bricke/Qt-AES)
242+
[![Matt Bricke](https://img.shields.io/badge/Github-Matt_Bricke-black?logo=github)](https://github.com/bricke/Qt-AES)
181243
[![UNLICENSE](https://img.shields.io/badge/License-Unlicense-green.svg)](https://github.com/bricke/Qt-AES?tab=Unlicense-1-ov-file)
182244

245+
### dotenv-cpp
246+
247+
An utility to load environment variables from a .env file
248+
249+
[![Heikki Johannes Hildén](https://img.shields.io/badge/Github-Heikki_Johannes_Hildén-black?logo=github)](https://github.com/laserpants)
250+
[![BSD-3](https://img.shields.io/badge/License-BSD_3-green.svg)](https://choosealicense.com/licenses/bsd-3-clause)
251+
183252
<p align="right">(<a href="#top">back to top</a>)</p>
184253

185254
## folder structure
@@ -242,7 +311,7 @@ Small and portable AES encryption class for Qt. Native support for all key sizes
242311

243312
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
244313

245-
Copyright (c) 2024 ZHENG Robert
314+
Copyright (c) 2025 ZHENG Robert
246315

247316
Permission is hereby granted, free of charge, to any person obtaining a copy
248317
of this software and associated documentation files (the "Software"), to deal

docs/dot.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SOURCE_FILE=/inpath/to/file.xlsx # Mandatory or mandatory via argument --source
2+
TARGET_FILE=/outpath/to/file.xlsx # Optional or optional via argument --target
3+
PWD=my_env_secret # Mandatory get password from $my_env_secret or mandatory via --pwd

src/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.23)
22

33
project(
44
qt-cli_file_encryption-decryption
5-
VERSION 0.1.0
5+
VERSION 0.2.0
66
DESCRIPTION "cli app to encrypt and decrypt a given file"
77
HOMEPAGE_URL "https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption"
88
LANGUAGES CXX)
@@ -36,10 +36,14 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
3636

3737
add_executable(
3838
${PROJECT_NAME}
39-
main.cpp includes/qaesencryption.cpp includes/qaesencryption.h
40-
includes/rz_options.h includes/cxxopts.hpp
39+
main.cpp
40+
includes/qaesencryption.cpp
41+
includes/qaesencryption.h
42+
includes/rz_options.h
43+
includes/cxxopts.hpp
4144
includes/rz_snippets.h
42-
includes/rz_qt-aes.h)
45+
includes/rz_qt-aes.h
46+
includes/dotenv.h)
4347
target_link_libraries(${PROJECT_NAME} Qt${QT_VERSION_MAJOR}::Core)
4448
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
4549

0 commit comments

Comments
 (0)