-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
75 lines (55 loc) · 1.57 KB
/
Copy pathmain.cpp
File metadata and controls
75 lines (55 loc) · 1.57 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @file main.cpp
* @author Sam Emison & Cole Belew
* @date 2024-10-17
* @brief Main
*
* Main.cpp for Steganography assignment
*/
#include <iostream>
#include "Steganography.h"
using namespace std;
int main() {
Steganography stego;
int choice; //Choice for the user to either encode or decode
cout << "Choose an operation: " << endl;
cout << "1. Encode a Message" << endl;
cout << "2. Decode a Message" << endl;
cout << "Enter a choice..." << endl;
cin >> choice;
//Encoding
if (choice == 1) {
string inputPPM, inputText, outputPPM;
cout << "Enter the PPM file name: " ;
cin >> inputPPM;
stego.readImage(inputPPM);
cout << "Enter text file name: ";
cin >> inputText;
stego.readCipherText(inputText);
cout << "Enter output PPM file name: ";
cin >> outputPPM;
stego.cleanImage();
stego.encipher();
stego.printImage(outputPPM);
cout << "Encoding Complete! " << endl;
cout << "Encoded image saved as: " << outputPPM << endl;
}
//Decoding
else if (choice == 2) {
string inputPPM, outputText;
cout << "Enter the PPM file name: ";
cin >> inputPPM;
stego.readImage(inputPPM);
string decodedText = stego.decipher();
cout << "Decoded Text: " << decodedText << endl;
cout << "Enter output text file name: ";
cin >> outputText;
stego.printCipherText(outputText);
cout << "Decoding Complete!" << endl;
cout << "Decoded text saved as: " << outputText << endl;
}
else {
cout << "Invalid choice. Terminating program..." << endl;
}
return 0;
}