-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebSteg.cpp
31 lines (24 loc) · 864 Bytes
/
WebSteg.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
#include "provided.h"
#include "http.h"
#include <string>
using namespace std;
bool WebSteg::hideMessageInPage(const string& url, const string& msg, string& host)
{
host = "";
string page;
if (!HTTP().get(url, page)) //ensures that the webpage is loaded correctly
return false;
if (Steg::hide(page, msg, host)) //ensures that the message can be hidden correctly in the page
return true;
return false;
}
bool WebSteg::revealMessageInPage(const string& url, string& msg)
{
msg = "";
string page;
if (!HTTP().get(url, page)) //ensures that the webpage is loaded correctly
return false;
if (Steg::reveal(page, msg)) //ensures that there is in fact a secret message, formatted
return true; //correctly that can be decoded
return false;
}