removed TEST_KEY & added more info for successful test

This commit is contained in:
Václav Šmejkal 2022-05-08 20:02:47 +02:00
parent 442c7f3175
commit 43ea16b596
2 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,6 @@
#define VERSIONS_NAME "versions.json" //do I have to explain this?
#define TEST_TEXT "Pepa smrdí." //TEST TEXT FOR ENCRYPTION IN why2-test BINARY
#define TEST_KEY "lZwOBFvjJEmaYRIaKsALKLkSeJvXhFPbZIRNFbjQRNyiOuLTexhgOpObHzyQgNT" //TEST KEY FOR ENCRYPTION IN why2-test BINARY
#define TEXT_TO_ENCRYPT "Some text yk" //THIS TEXT WILL BE ENCRYPTED IN why2-app BINARY

View File

@ -9,18 +9,23 @@
int main(void)
{
char *buffer;
inputFlags flags =
{
1, //SKIP CHECK
0, //NO OUTPUT
};
outputFlags encrypted = encryptText(TEST_TEXT, TEST_KEY, flags);
encrypted = decryptText(encrypted.outputText, TEST_KEY, flags);
outputFlags encrypted = encryptText(TEST_TEXT, NULL, flags);
buffer = encrypted.outputText; //GET ENCRYPTED TEXT
encrypted = decryptText(encrypted.outputText, encrypted.usedKey, flags);
if (strcmp(encrypted.outputText, TEST_TEXT) == 0)
{
printf("Test successful!\n");
printf("Test successful!\n\nTEXT: %s\nOUTPUT: %s\nKEY: %s\n", TEST_TEXT, buffer, encrypted.usedKey);
}
else
{