{"id":26244239,"url":"https://github.com/zheng-bote/qt-cli_file_encryption-decryption","last_synced_at":"2025-12-26T21:20:22.277Z","repository":{"id":280576400,"uuid":"942458777","full_name":"Zheng-Bote/qt-cli_file_encryption-decryption","owner":"Zheng-Bote","description":"Qt6 C++23 commandline application to encrypt or decrypt a given file on Linux, MacOS, Windows with AES-256 CBC","archived":false,"fork":false,"pushed_at":"2025-03-09T16:09:16.000Z","size":422,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T08:41:26.785Z","etag":null,"topics":["aes-256-cbc","cpp23","linux-shell","macos-cli","qt6","windows-cli"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zheng-Bote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-04T06:18:24.000Z","updated_at":"2025-03-09T16:09:19.000Z","dependencies_parsed_at":"2025-03-04T07:26:55.349Z","dependency_job_id":"68199750-c103-4205-b653-874e72aeaca7","html_url":"https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption","commit_stats":null,"previous_names":["zheng-bote/qt-cli_file_encryption-decryption"],"tags_count":0,"template":false,"template_full_name":"Zheng-Bote/repo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zheng-Bote%2Fqt-cli_file_encryption-decryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zheng-Bote%2Fqt-cli_file_encryption-decryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zheng-Bote%2Fqt-cli_file_encryption-decryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zheng-Bote%2Fqt-cli_file_encryption-decryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zheng-Bote","download_url":"https://codeload.github.com/Zheng-Bote/qt-cli_file_encryption-decryption/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-256-cbc","cpp23","linux-shell","macos-cli","qt6","windows-cli"],"created_at":"2025-03-13T11:18:53.446Z","updated_at":"2025-12-26T21:20:22.265Z","avatar_url":"https://github.com/Zheng-Bote.png","language":"C++","readme":"\u003cdiv id=\"top\" align=\"center\"\u003e\n\u003ch1\u003efile encryption/decryption\u003c/h1\u003e\n\n\u003ch4\u003eFile encryption and decryption (shell/commandline)\u003c/h4\u003e\n\u003ch6\u003efor Linux, MacOS, Windows\u003c/h6\u003e\n\n[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)\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Zheng-Bote/qt-cli_file_encryption-decryption?logo=GitHub)](https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption/releases)\n\n\u003c/div\u003e\n\n\u003chr\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Description](#description)\n  - [Features](#features)\n- [Status](#status)\n- [breaking Changes](#breaking-changes)\n- [Documentation](#documentation)\n  - [Usage](#usage)\n    - [Rules](#rules)\n  - [Encryption](#encryption)\n    - [Linux](#linux)\n  - [Decryption](#decryption)\n    - [Linux](#linux-1)\n  - [configuration: dotenv or env](#configuration-dotenv-or-env)\n  - [Test / Performance](#test--performance)\n- [Installation](#installation)\n  - [Linux](#linux-2)\n  - [MacOS](#macos)\n  - [Windows](#windows)\n- [Development](#development)\n  - [Dependencies](#dependencies)\n    - [CMake](#cmake)\n    - [QT](#qt)\n    - [Qt-AES](#qt-aes)\n    - [dotenv-cpp](#dotenv-cpp)\n  - [folder structure](#folder-structure)\n- [Authors and License](#authors-and-license)\n  - [MIT License](#mit-license)\n  - [Authors](#authors)\n    - [Code Contributors](#code-contributors)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\u003chr\u003e\n\n# Description\n\n![QT](https://img.shields.io/badge/Community-6-41CD52?logo=qt)\n![CXX](https://img.shields.io/badge/C++-23-blue?logo=cplusplus)\n\nQt6 C++23 shell/commandline application to encrypt / decrypt the given file.\n\n- Encryption: AES-256 CBC\n- Password: SHA256, between 5 to 32 characters\n- initialization vector: MD5\n\nsee also the Desktop version [qt-desktop_file_encryption-decryption](https://github.com/Zheng-Bote/qt-desktop_file_encryption-decryption)\n\n## Features\n\n- [x] encrypt/decrypt every readable file (binary-mode, chunk size 4MB)\n- [ ] i18n\n\n- [x] runs on DOS/Windows (shell/commandline)\n- [x] runs on MacOS (cli)\n- [x] runs on Linux (cli)\n- [ ] runs on iOS\n- [ ] runs on Android\n- [ ] runs on HarmonyOS\n- [ ] supports pipe operator or arguments\n- [x] supports arguments and dotenv file\n\n- [x] OSS and license\n- [x] works as designed\n- [ ] no bugs\n\n- [x] some more or less usefull Github Actions for GH-repo, GH-pages, GH-wiki, CI/CD-Pipelines\n- [ ] Packagemanager\n- [x] Buildsystem: CMake\n- [x] Installation routine (no Adminstrator rights needed)\n- [ ] portable application\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n# Status\n\n![GitHub Created At](https://img.shields.io/github/created-at/Zheng-Bote/qt-cli_file_encryption-decryption)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Zheng-Bote/qt-cli_file_encryption-decryption?logo=GitHub)](https://github.com/Zheng-Bote/qt-cli_file_encryption-decryption/releases)\n![GitHub Release Date](https://img.shields.io/github/release-date/Zheng-Bote/qt-cli_file_encryption-decryption)\n![Status](https://img.shields.io/badge/Status-stable-green)\n![Status](https://img.shields.io/badge/Status-works_as_designed-green)\n\n![GitHub Issues](https://img.shields.io/github/issues/Zheng-Bote/qt-cli_file_encryption-decryption)\n![GitHub Pull Requests](https://img.shields.io/github/issues-pr/Zheng-Bote/qt-cli_file_encryption-decryption)\n\n# breaking Changes\n\n\u003e \\[!CAUTION]\n\u003e Please be aware of breaking changes\n\n| Version | status                                  | Comment                                                            |\n| ------- | --------------------------------------- | ------------------------------------------------------------------ |\n| v0.1.0  | **NOT** compatible to higher versions.  | initial creation, text mode                                        |\n| v1.0.0  | **NOT** compatible with lower versions. | optimized input/output, text mode limited to some text-based files |\n| v2.0.0  | **NOT** compatible with lower versions. | binary-mode, works on every readable file. No filesize limit.      |\n\n# Documentation\n\n## Usage\n\n```cli\nfile_encryption-decryption-x86_64 -h\n\ncli app to encrypt and decrypt a given file\nUsage:\n  qt-cli_file_encryption-decryption [OPTION...]\n\n  -s, --source arg  \u003cpath/to/sourcefile\u003e to en-/de-crypt. Mandatory: -s | -d\n  -t, --target arg  target \u003cpath/to/outputfile\u003e. Optional: -t | -d\n  -p, --pwd arg     name of password env variable. Mandatory: -p | -d\n  -d, --dotenv arg  \u003cpath/to/dotenv\u003e file. Mandatory: -s | -p | -d\n  -h, --help        Print help\n```\n\n### Rules\n\n**encryption or decryption**\n\n- if sourcefile has not extension `.aes`, sourcefile will be encrypted as targetfile `\u003csourcefile\u003e.aes`\n- if sourcefile has extension `.aes`, sourcefile will be decrypted as targetfile `\u003csourcefile\u003e` (without extension `.aes`)\n\n\u003e \\[!WARNING]\n\u003e existing targetfile will be overwritten\n\n```mermaid\nflowchart TD;\n    A[\"path/to/sourcefile\"]-. \"has not .aes\" .-\u003eB[[encrypt sourcefile]]\n    B-- \"has --target\" --\u003eC[\"new/path/to/sourcefile.aes\"]\n    B-- \"has no --target\" --\u003eD[\"path/to/sourcefile.aes\"]\n\n    A[\"path/to/sourcefile\"]-. \"has .aes\" .-\u003eF[[\"decrypt sourcefile\"]]\n    F-- \"has --target\" --\u003eG[\"new/path/to/sourcefile\"]\n    F-- \"has no --target\" --\u003eH[\"path/to/sourcefile\"]\n```\n\n**dotenv-file vs env variables**\n\nThe program works with given arguments and/or given dotenv-file.\n\n- if an entry is not defined (dotenv-file, environment variable, argument), the program exit with failure\n- a given argument overwrites a dotenv-file entry\n- if a given dotenv-file entry is missing, the program looks for the related environment variable\n\n```mermaid\nflowchart TD;\n    A[\"Variable\"]--\u003eDotenv{\"is defined in dotenv-file\"}\n    Dotenv-. \"Y\" .-\u003eS1[[\"set environment variable\"]]\n    S1[[\"set environment variable\"]]--\u003eAttrib{\"is defined as attribute\"}\n    Dotenv-. \"N\" .-\u003eAttrib{\"is defined as attribute\"}\n    Attrib-. \"Y\" .-\u003eS[[\"set environment variable\"]]\n    Attrib-. \"N\" .-\u003eV{\"get environment variable\"}\n    S--\u003eV\n\n    V-- \"is empty\" --\u003eE(\"EXIT\")\n    V-- \"not empty and valid\" --\u003eP[[\"encrypt or decrypt file\"]]\n```\n\n## Encryption\n\n\u003e \\[!WARNING]\n\u003e don't loose your password. Decryption/Recovery without valid password is impossible!\n\n### Linux\n\n**encrypt**\n\nEncrypt `/path/to/sourcefile.xlsx` to `/path/to/sourcefile.xlsx.aes` with environment password-variable\n\n```cli\nexport my_secret_env_var=\"my_top_secret_password\"\n./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx --pwd my_secret_env_var\n```\n\nEncrypt `/path/to/sourcefile.xlsx` to `/new/path/to/targetfile.xlsx.aes` with dotenv-file\n\n```cli\n./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx --target /new/path/to/targetfile.xlsx --dotenv /my/configpath/.file_enc-dec\n```\n\n## Decryption\n\n### Linux\n\n**decrypt**\n\nDecrypt `/path/to/sourcefile.xlsx.aes` to `/path/to/sourcefile.xlsx`\n\n```cli\n./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx.aes ...\n```\n\nDecrypt `/path/to/sourcefile.xlsx.aes` to `/new/path/to/targetfile.xlsx`\n\n```cli\n./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx.aes --target /new/path/to/targetfile.xlsx ...\n```\n\n## configuration: dotenv or env\n\nExample dotenv file `.env`\n\n```cli\nexport my_env_secret=\"my_top_secret_password\"\n# PWD =\u003e $my_secret_env_var =\u003e my_top_secret_password\n```\n\n```dotenv\nSOURCE_FILE=/inpath/to/file.xlsx    # Mandatory or mandatory via argument --source\nTARGET_FILE=/outpath/to/file.xlsx   # Optional or optional via argument --target\nPWD=my_secret_env_var               # Mandatory get password from $my_secret_env_var or mandatory via --pwd my_secret_env_var\n```\n\n```cli\n./file_encryption-decryption-x86_64.AppImage --source /path/to/sourcefile.xlsx --pwd my_secret_env_var\n```\n\n## Test / Performance\n\n**tested on**\n\n- x86_64 Ubuntu 24.04.2 LTS\n- Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz with 6 cpu cores\n- average SSD storage\n- fallocate -l 1G test.img\n\n**read / write binary mode of 1 GB file with a chunk size of 4 MB**\n| type | val |\n| ---- | --------- |\n| real | 5m52,734s |\n| user | 5m49,905s |\n| sys | 0m2,391s |\n\n**read / write binary mode of 1 GB file with a chunk size of 16 MB**\n| type | val |\n| ---- | --------- |\n| real | 5m50,753s |\n| user | 5m48,691s |\n| sys | 0m2,049s |\n\n=\u003e so compiled chunk size is 4 MB to give better feedback about the process status.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n# Installation\n\n## Linux\n\nSeveral installation packages are available, depending on your Linux system (deb, rpm, zip, AppImage).\n\n\u003e \\[!Note]\n\u003e see (latest) Release for packages\n\n## MacOS\n\n- make DiskImage executable (eg. `chmod 755 file_encryption-decryption.dmg`)\n- execute / double-click on the `.dmg` file. A window should appear showing the program you are installing and the Applications Folder.\n- drag the program into the Applications Folder; macOS will automatically install the software for you.\n\n## Windows\n\n_under construction_\n\n# Development\n\n## Dependencies\n\n\u003e \\[!NOTE]\n\u003e All licenses are therefore Open Source.\n\n### CMake\n\nCMake: A Powerful Software Build System\n\n[![CMake](https://img.shields.io/badge/CMake-v3.23+-064F8C?logo=cmake)](https://github.com/conan-io/conan)\n[![BSD-3 License](https://img.shields.io/badge/License-BSD_3-green.svg)](https://choosealicense.com/licenses/bsd-3-clause/)\n\n### QT\n\n\u003e \\[!NOTE]\n\u003e _QT6 - Community Edition_ \u003e= 6.7\n\nThe Qt framework contains a comprehensive set of highly intuitive and modularized C++ library classes and is loaded with APIs to simplify your application development. Qt produces highly readable, easily maintainable and reusable code with high runtime performance and small footprint – and it's cross-platform.\n\n[![QT](https://img.shields.io/badge/Community-for_Open_Source_Development-black?logo=qt)](https://www.qt.io/download-open-source)\n[![LGPL](https://img.shields.io/badge/License-LGPL_v3-green.svg)](https://choosealicense.com/licenses/lgpl-3.0/) _see also:_[Obligations of the GPL and LGPL](https://www.qt.io/licensing/open-source-lgpl-obligations)\n\n### Qt-AES\n\nSmall 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\n\n[![Matt Bricke](https://img.shields.io/badge/Github-Matt_Bricke-black?logo=github)](https://github.com/bricke/Qt-AES)\n[![UNLICENSE](https://img.shields.io/badge/License-Unlicense-green.svg)](https://github.com/bricke/Qt-AES?tab=Unlicense-1-ov-file)\n\n### dotenv-cpp\n\nAn utility to load environment variables from a .env file\n\n[![Heikki Johannes Hildén](https://img.shields.io/badge/Github-Heikki_Johannes_Hildén-black?logo=github)](https://github.com/laserpants)\n[![BSD-3](https://img.shields.io/badge/License-BSD_3-green.svg)](https://choosealicense.com/licenses/bsd-3-clause)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## folder structure\n\n\u003c!-- readme-tree start --\u003e\n```\n.\n├── .github\n│   ├── actions\n│   │   └── doctoc\n│   │       ├── README.md\n│   │       ├── action.yml\n│   │       └── dist\n│   │           ├── index.js\n│   │           ├── index.js.map\n│   │           ├── licenses.txt\n│   │           └── sourcemap-register.js\n│   └── workflows\n│       ├── ghp-call_Readme.yml\n│       ├── ghp-create_doctoc.yml\n│       ├── ghp-markdown_index.yml\n│       ├── repo-actions_docu.yml\n│       ├── repo-call_Readme.yml\n│       ├── repo-create_doctoc.yml_\n│       ├── repo-create_doctoc_md.yml\n│       └── repo-create_tree_readme.yml\n├── .gitignore\n├── LICENSE\n├── README.md\n├── docs\n│   └── dot.env\n├── src\n│   ├── .gitignore\n│   ├── CMakeLists.txt\n│   ├── configure\n│   │   ├── ClangTidy.cmake\n│   │   ├── Doxygen.cmake\n│   │   ├── extra_headers\n│   │   └── rz_config.h.in\n│   ├── includes\n│   │   ├── cxxopts.hpp\n│   │   ├── dotenv.h\n│   │   ├── qaesencryption.cpp\n│   │   ├── qaesencryption.h\n│   │   ├── rz_config.h\n│   │   ├── rz_options.h\n│   │   ├── rz_qt-aes.h\n│   │   └── rz_snippets.h\n│   └── main.cpp\n└── tree.bak\n\n10 directories, 34 files\n```\n\u003c!-- readme-tree end --\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n# Authors and License\n\n## MIT License\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n\nCopyright (c) 2025 ZHENG Robert\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Authors\n\n- [![Zheng Robert](https://img.shields.io/badge/Github-Zheng_Robert-black?logo=github)](https://www.github.com/Zheng-Bote)\n\n### Code Contributors\n\n![Contributors](https://img.shields.io/github/contributors/Zheng-Bote/qt-cli_file_encryption-decryption?color=dark-green)\n\n[![Zheng Robert](https://img.shields.io/badge/Github-Zheng_Robert-black?logo=github)](https://www.github.com/Zheng-Bote)\n\n\u003chr\u003e\n\n:vulcan_salute:\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n````\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheng-bote%2Fqt-cli_file_encryption-decryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzheng-bote%2Fqt-cli_file_encryption-decryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheng-bote%2Fqt-cli_file_encryption-decryption/lists"}