-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCases.cpp
More file actions
41 lines (28 loc) · 1015 Bytes
/
TestCases.cpp
File metadata and controls
41 lines (28 loc) · 1015 Bytes
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
/*
* TestCases.cpp
*/
#include <iostream>
#include "DESAlgorithm.h"
using namespace std;
int main(int argc, char* argv[])
{
string plainText = "1000010111101000000100110101010000001111000010101011010000000101";
string key1 = "0000000000000000000000000000000000000000000010000000000000000000";
string key2 = "0000000000000000000000000000000000000000000100000000000000000000";
string key3 = "0000000000000000000000000000000000000000001000000000000000000000";
cout << "\n\nplain Text : " << plainText << endl;
DESAlgorithm desObj(plainText, 16);
cout << "Case 1: \n";
cout << "key : " << key1 << endl;
cout << "cipher Text: " << desObj.encrypt(key1) << endl;
cout << endl << endl;
cout << "Case 2: \n";
cout << "key : " << key2 << endl;
cout << "cipher Text: " << desObj.encrypt(key2) << endl;
cout << endl << endl;
cout << "Case 3: \n";
cout << "key : " << key3 << endl;
cout << "cipher Text: " << desObj.encrypt(key3) << endl;
cout << endl << endl;
return 0;
}