I want to write console application. To be more precise, it will be "Who wants to be a millionaire" game.
It is just for fun, nothing else.
So, I need to have this hmm, lets say database of all those questions, and correct answers.
Now, what is the best way of storing this data, so that user can't read it, and also important thing is portability.
If I would have to install MySQL server, that is bad idea,
because I don't know if my friend, who wants to play this, has it on his computer.
void Transform(string& s)
{
staticconstchar key = 0xB6;
for(unsigned i = 0; i < s.size(); ++i)
s[i] ^= key;
}
int main()
{
string data = "This is your questions and answers";
// to save it to a file
Transform(data);
WriteDataToFile(data);
// to get it from a file
data = ReadDataFromFile();
Transform(data);
cout << data;
}
Not very secure, but it will be enough to stop most non-techie people from cheating, and it's very simple.
That just make it easier for me to pick a suitable one. I figured it would be best to flip some bits but not all, and to avoid having a null terminator in the encrypted string.