-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
// main.cpp : This file contains the 'main' function. Program execution begins and ends there. | ||
// | ||
#define VERSION "BlazeEncryptions v2.0" | ||
#define USAGE "\ | ||
Usage: BlazeEncryptions [--old] [--new] [--encrypt] [--decrypt] [--keygen] [-h] [--help] [--version]\n\ | ||
Options: --old (Uses the older Encryption/Decryption method for compatibility with BlazeEncryptions v1.x and less secure) --new (Uses the Newer Encryption/Decryption method which is more secure but not compatible with v1.x) --encrypt (Encrypt a message) --decrypt (Decrypt a message) --help or -h (Prints this exact messaage) --version (Prints out the version of this Scalc binary)" | ||
#define COPYRIGHT "Copyright (c) 2022 winexe0 <[email protected]> Albert Nguyen <[email protected]>" | ||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
@@ -8,10 +13,70 @@ | |
#include <sstream> | ||
#include "split.h" | ||
#include "new/new.h" | ||
#include "new/encrypt.h" | ||
#include "new/decrypt.h" | ||
#include "new/keygen.h" | ||
#include "old/old.h" | ||
#include "old/decrypt.h" | ||
#include "old/encrypt.h" | ||
using namespace std; | ||
int main(int argc, char** argv) { | ||
int cryptMethod; | ||
for (int i = 1; i < argc; ++i) { | ||
string arg = argv[i]; | ||
if (arg == "--help" || arg == "-h") { | ||
cout << VERSION << endl; | ||
cout << USAGE << endl; | ||
exit(0); | ||
} | ||
if (arg == "--version") { | ||
cout << VERSION << endl; | ||
cout << COPYRIGHT << endl; | ||
exit(0); | ||
} | ||
if (arg == "--old") { | ||
old(); | ||
return 0; | ||
} | ||
if (arg == "--new") { | ||
New(); | ||
return 0; | ||
} | ||
if (arg == "--encrypt") { | ||
cout << "Which Encryption Method would you like to use:\n1. Newer Encryption Method (More Secure, but not compatible with BlazeEncryptions v1.x)\n2. Older Encryption Method (Less Secure, but compatible with BlazeEncryptions v1.x)\nPlease type 1 or 2 and press enter." << endl; | ||
cin >> cryptMethod; | ||
if (cryptMethod == 1) { | ||
Newencrypt(); | ||
return 0; | ||
} | ||
if (cryptMethod == 2) { | ||
encrypt(); | ||
return 0; | ||
} | ||
} | ||
if (arg == "--decrypt") { | ||
cout << "Are you decrypting for:\n1. The Newer Encryption Method \n2. The Older Encryption Method\nPlease type 1 or 2 and press enter." << endl; | ||
cin >> cryptMethod; | ||
if (cryptMethod == 1) { | ||
Newencrypt(); | ||
return 0; | ||
} | ||
if (cryptMethod == 2) { | ||
encrypt(); | ||
return 0; | ||
} | ||
} | ||
if (arg == "--keygen") { | ||
keygen(); | ||
} | ||
else { | ||
cout << VERSION << endl; | ||
cout << "Invalid argument" << endl; | ||
cout << USAGE << endl; | ||
exit(0); | ||
} | ||
} | ||
cout << VERSION << endl; | ||
cout << "Which Encryption Method would you like to use:\n1. Newer Encryption Method (More Secure, but not compatible with BlazeEncryptions v1.x)\n2. Older Encryption Method (Less Secure, but compatible with BlazeEncryptions v1.x)\nPlease type 1 or 2 and press enter." << endl; | ||
cin >> cryptMethod; | ||
if (cryptMethod == 1) { | ||
|