-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
61 lines (50 loc) · 1.4 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <string>
#include "ssdes.h"
using namespace std;
/*
Script para rodar testes no sistema SSDES.
*/
int main() {
int select, key, rounds;
string input, output;
cout << "\tSimulador do Super Simplified DES";
while (1) {
cout << "\n\t1. Teste padrão - encriptar" << endl;
cout << "\t2. Teste padrão - desencriptar" << endl;
cout << "\t3. Teste do usuário - encriptar" << endl;
cout << "\t4. Teste do usuário - desencriptar" << endl;
cout << "\t5. Sair" << endl << "\t";
cin >> select;
switch (select) {
case 1: encrypt_text("input.txt", "input_encrypted.txt", 45, 16);
break;
case 2: decrypt_text("input_encrypted.txt", "input_decrypted.txt", 45, 16);
break;
case 3: cout << "\n\tNome do arquivo de entrada: ";
cin >> input;
cout << "\tNome do arquivo de saida: ";
cin >> output;
cout << "\tChave: ";
cin >> key;
cout << "\tRounds: ";
cin >> rounds;
encrypt_text(input, output, key, rounds);
break;
case 4: cout << "\n\tNome do arquivo de entrada: ";
cin >> input;
cout << "\tNome do arquivo de saida: ";
cin >> output;
cout << "\tChave: ";
cin >> key;
cout << "\tRounds: ";
cin >> rounds;
decrypt_text(input, output, key, rounds);
break;
case 5: exit(0);
default: cout << "\n\tOpção inválida, tente novamente\n" << endl;
break;
}
}
return 0;
}