WHY2/src/core/app/main.c

49 lines
1.5 KiB
C
Raw Normal View History

/*
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2022-05-04 18:28:15 +02:00
#include <stdio.h>
2022-05-12 17:12:33 +02:00
#include <why2.h>
2022-05-04 18:58:51 +02:00
2022-05-04 18:28:15 +02:00
int main(void)
{
2022-07-10 18:17:42 +02:00
//SET FLAGS
why2_set_flags((why2_input_flags) { 1, 1, 0, WHY2_v4, WHY2_OUTPUT_TEXT });
2022-07-10 18:17:42 +02:00
//RUN ENCRYPTION WITH WHY2_TEXT_TO_ENCRYPT, GENERATE NEW KEY AND DO NOT CHECK FOR ACTIVE WHY2_VERSION & PREVENT ANY OUTPUT
why2_output_flags encryptedText = why2_encrypt_text(WHY2_TEXT_TO_ENCRYPT, NULL);
2022-05-04 18:58:51 +02:00
2022-05-26 18:52:24 +02:00
//SIMPLE TEXT
2022-05-04 18:58:51 +02:00
printf
(
"Hi.\n"
"This is a simple application written using WHY2 Encryption System.\n\n"
2022-05-04 18:58:51 +02:00
"\"%s\" => \"%s\"\n\n"
"If you'd like to know more about WHY2 Encryption System, please visit: https://github.com/ENGO150/WHY2/wiki \b\n"
2022-05-04 18:58:51 +02:00
"Thank you so much for supporting this project!\n"
, WHY2_TEXT_TO_ENCRYPT, encryptedText.output_text
2022-05-04 18:58:51 +02:00
);
2022-05-08 19:56:16 +02:00
//DEALLOCATION
why2_deallocate_output(encryptedText);
2022-05-08 19:56:16 +02:00
2022-05-04 18:28:15 +02:00
return 0;
}