Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35175790e2 | |||
| 04ea4fb848 | |||
| 5c61ba7ea8 | |||
| a45b304d22 | |||
| 403d013224 |
@@ -1 +1 @@
|
|||||||
Hello, this is a test file for encryption!
|
Test file content for decryption
|
||||||
|
|||||||
BIN
files/out2.otp
Normal file
BIN
files/out2.otp
Normal file
Binary file not shown.
BIN
files/test_files_dir.txt.otp
Normal file
BIN
files/test_files_dir.txt.otp
Normal file
Binary file not shown.
18
otp.c
18
otp.c
@@ -117,7 +117,7 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int interactive_mode(void) {
|
int interactive_mode(void) {
|
||||||
printf("\n\n\n\n=== OTP Cipher %s ===\n\n", get_version());
|
// printf("\n\n\n\n=== OTP Cipher %s ===\n\n", get_version());
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
show_main_menu();
|
show_main_menu();
|
||||||
@@ -133,7 +133,7 @@ int interactive_mode(void) {
|
|||||||
handle_file_encrypt();
|
handle_file_encrypt();
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
handle_smart_decrypt();
|
handle_decrypt_menu();
|
||||||
break;
|
break;
|
||||||
case 'G':
|
case 'G':
|
||||||
handle_generate_menu();
|
handle_generate_menu();
|
||||||
@@ -275,7 +275,9 @@ int command_line_mode(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void show_main_menu(void) {
|
void show_main_menu(void) {
|
||||||
printf("======================== Main Menu ========================\n");
|
|
||||||
|
printf("\n\n\n\n=========================== Main Menu - OTP %s ===========================\n\n", get_version() );
|
||||||
|
|
||||||
printf(" \033[4mT\033[0mext encrypt\n");
|
printf(" \033[4mT\033[0mext encrypt\n");
|
||||||
printf(" \033[4mF\033[0mile encrypt\n");
|
printf(" \033[4mF\033[0mile encrypt\n");
|
||||||
printf(" \033[4mD\033[0mecrypt\n");
|
printf(" \033[4mD\033[0mecrypt\n");
|
||||||
@@ -1579,14 +1581,18 @@ int encrypt_file(const char* pad_identifier, const char* input_file, const char*
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate output filename if not specified
|
// Generate output filename if not specified, using files directory
|
||||||
char default_output[512];
|
char default_output[512];
|
||||||
if (output_file == NULL) {
|
if (output_file == NULL) {
|
||||||
|
char temp_output[512];
|
||||||
if (ascii_armor) {
|
if (ascii_armor) {
|
||||||
snprintf(default_output, sizeof(default_output), "%s.otp.asc", input_file);
|
snprintf(temp_output, sizeof(temp_output), "%s.otp.asc", input_file);
|
||||||
} else {
|
} else {
|
||||||
snprintf(default_output, sizeof(default_output), "%s.otp", input_file);
|
snprintf(temp_output, sizeof(temp_output), "%s.otp", input_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply files directory default path
|
||||||
|
get_default_file_path(temp_output, default_output, sizeof(default_output));
|
||||||
output_file = default_output;
|
output_file = default_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
test_files_dir.txt
Normal file
1
test_files_dir.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Testing updated files directory functionality
|
||||||
1
test_new.txt
Normal file
1
test_new.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Testing files directory functionality
|
||||||
BIN
test_new.txt.otp
Normal file
BIN
test_new.txt.otp
Normal file
Binary file not shown.
Reference in New Issue
Block a user