2022-03-20 18:12:25 +01:00
|
|
|
#ifndef WHY2_FLAGS_H
|
|
|
|
#define WHY2_FLAGS_H
|
|
|
|
|
2022-05-02 18:01:12 +02:00
|
|
|
//CONSTS
|
2022-05-04 19:27:51 +02:00
|
|
|
#define ENCRYPTION_SEPARATOR '.' //SEPARATOR BETWEEN KEYS
|
|
|
|
#define ENCRYPTION_SEPARATOR_STRING "." //SAME AS ENCRYPTION_SEPARATOR BUT AS STRING
|
2022-03-20 18:12:25 +01:00
|
|
|
|
2022-05-04 19:27:51 +02:00
|
|
|
#define INVALID_KEY 1 //EXIT VALUE FOR INVALID KEY
|
2022-06-12 16:11:27 +02:00
|
|
|
#define INVALID_TEXT 4 //EXIT VALUE FOR INVALID TEXT
|
2022-05-21 18:37:24 +02:00
|
|
|
#define DOWNLOAD_FAILED 2 //EXIT VALUE FOR versions.json DOWNLOAD FAILED
|
2022-06-12 16:11:27 +02:00
|
|
|
#define UPDATE_FAILED 3 //EXIT VALUE FOR UPDATE FAILED
|
2022-03-20 18:12:25 +01:00
|
|
|
|
2022-06-11 19:26:28 +02:00
|
|
|
#define VERSION "v4.2" //VERSION OF CURRENT BUILD > DO NOT TOUCH THIS <
|
2022-06-11 16:22:44 +02:00
|
|
|
#define VERSIONS_URL "https://raw.githubusercontent.com/ENGO150/WHY2/release/versions.json" //URL FOR GETTING versions.json
|
2022-05-31 19:39:59 +02:00
|
|
|
#define VERSIONS_NAME "/tmp/why2-versions.json" //do I have to explain this?
|
2022-04-04 18:07:42 +02:00
|
|
|
|
2022-06-11 17:04:15 +02:00
|
|
|
#define UPDATE_URL "https://github.com/ENGO150/WHY2.git" // REPOSITORY URL FOR UPDATES (YOU DON'T SAY)
|
|
|
|
#define UPDATE_NAME "/tmp/why2-update" // fuck you
|
2022-06-11 18:54:34 +02:00
|
|
|
#define UPDATE_COMMAND "tmux new-session -d \"cd {DIR} && make install\""
|
2022-06-11 17:04:15 +02:00
|
|
|
|
2022-05-29 17:03:48 +02:00
|
|
|
#define TEST_TEXT "aAzZ( )!?#\\/śŠ <3|420*;" //TEST TEXT FOR ENCRYPTION IN why2-test BINARY
|
2022-05-05 18:26:10 +02:00
|
|
|
|
|
|
|
#define TEXT_TO_ENCRYPT "Some text yk" //THIS TEXT WILL BE ENCRYPTED IN why2-app BINARY
|
|
|
|
|
|
|
|
#define CLEAR_SCREEN "\e[1;1H\e[2J" //TEXT FOR UNIX CLEAR SCREEN
|
|
|
|
|
|
|
|
#define NOT_FOUND_TRIES 10 //NUMBER OF TRIES FOR DOWNLOADING versions.json
|
|
|
|
|
2022-05-21 18:37:24 +02:00
|
|
|
#define DEPRECATED __attribute__((deprecated)) //SAME COMMENT AS VERSIONS_NAME'S
|
2022-05-05 18:38:30 +02:00
|
|
|
|
2022-05-25 17:27:26 +02:00
|
|
|
typedef struct
|
2022-05-05 18:50:45 +02:00
|
|
|
{
|
2022-06-08 19:23:20 +02:00
|
|
|
unsigned char noCheck; //BOOLEAN FOR SKIPPING VERSION CHECK
|
2022-05-25 17:32:34 +02:00
|
|
|
unsigned char noOutput; //BOOLEAN FOR NOT PRINTING OUTPUT WHEN ENCRYPTING/DECRYPTING
|
2022-06-08 19:25:54 +02:00
|
|
|
unsigned char noUpdate; //BOOLEAN FOR NOT UPDATING YOUR WHY VERSION IF OLD IS USED
|
2022-05-05 19:03:53 +02:00
|
|
|
} inputFlags;
|
|
|
|
|
2022-05-25 17:27:26 +02:00
|
|
|
typedef struct
|
2022-05-05 19:03:53 +02:00
|
|
|
{
|
2022-05-06 18:14:45 +02:00
|
|
|
char *outputText; //VARIABLE FOR ENCRYPTED/DECRYPTED TEXT
|
|
|
|
char *usedKey; //VARIABLE FOR USED/GENERATED KEY
|
2022-05-30 19:09:47 +02:00
|
|
|
unsigned long unusedKeySize; //VARIABLE FOR COUNT OF UNUSED CHARACTERS IN KEY
|
|
|
|
unsigned long elapsedTime; //VARIABLE FOR ELAPSED TIME IN MICROSECONDS => 1s = 1000000µs
|
2022-05-06 17:43:00 +02:00
|
|
|
} outputFlags;
|
2022-05-05 18:50:45 +02:00
|
|
|
|
2022-05-02 18:01:12 +02:00
|
|
|
//VARIABLES
|
2022-05-31 18:20:24 +02:00
|
|
|
static unsigned long keyLength = 50; //LENGTH OF KEY > DO NOT TOUCH THIS, USE setKeyLength() instead <
|
2022-05-04 18:42:30 +02:00
|
|
|
|
2022-05-04 19:21:31 +02:00
|
|
|
//GETTERS
|
2022-05-29 17:45:34 +02:00
|
|
|
unsigned long getKeyLength();
|
2022-05-27 17:26:20 +02:00
|
|
|
inputFlags noFlags(); //THIS GENERATES inputFlags WITH DEFAULT VALUES
|
2022-05-04 19:21:31 +02:00
|
|
|
|
|
|
|
//SETTERS
|
|
|
|
void setKeyLength(int keyLengthNew);
|
2022-05-04 18:42:30 +02:00
|
|
|
|
2022-04-07 17:26:41 +02:00
|
|
|
#endif
|