-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (41 loc) · 1.73 KB
/
Copy pathmain.cpp
File metadata and controls
51 lines (41 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2026 DGKN@Labs. All rights reserved.
// SPDX-License-Identifier: LicenseRef-DGKN-Evaluation
// Part of the DGKN@Labs Crypto Suite v7.0.0 — see LICENSE (Evaluation License).
#include <iostream>
#include <string>
#include "Config.hpp"
#include "core/Manager.hpp"
int main(int argc, char* argv[]) {
std::cout << "=================================================\n";
std::cout << " DGKN Crypto Suite v" << dgkn::config::APP_VER << " (Native C++ Edition)\n";
std::cout << "=================================================\n\n";
dgkn::core::ContainerManager manager;
std::string mode, input, output, password;
std::cout << "Modus waehlen (E = Encrypt / D = Decrypt): ";
std::getline(std::cin, mode);
if (mode != "E" && mode != "e" && mode != "D" && mode != "d") {
std::cout << "Fehler: Ungueltiger Modus.\n";
return 1;
}
std::cout << "Pfad zur Original-Datei : ";
std::getline(std::cin, input);
std::cout << "Pfad zur Ausgabe-Datei : ";
std::getline(std::cin, output);
std::cout << "Passwort : ";
std::getline(std::cin, password);
std::cout << "\nVerarbeite Kryptografie... Bitte warten.\n";
bool success = false;
try {
if (mode == "E" || mode == "e") {
success = manager.encrypt_file(input, output, password);
} else {
success = manager.decrypt_file(input, output, password);
}
} catch (const std::exception& e) {
std::cout << "\n[EXCEPTION] " << e.what() << "\n";
return 2;
}
if (success) std::cout << "\n[ERFOLG] Vorgang erfolgreich abgeschlossen!\n";
else std::cout << "\n[FEHLER] Fehlgeschlagen! Falsches Passwort oder korrupte Datei?\n";
return 0;
}