I made a new game but the save files are easily modified to lets say give you a tactical advantage
does anyone know a good site on basic encryption
noithing to fancy pls
Thank You
I made a new game but the save files are easily modified to lets say give you a tactical advantage
does anyone know a good site on basic encryption
noithing to fancy pls
Thank You
Or you could save the data in binary (I guess you save it as text now). Add ios::binary to the flags when you open the file and use write/read to save/load the data.Code:void EncryptString(char* String) { int Length = strlen(String); for(int i=0; i<Length; i++) { String[i]++; } } void DecryptString(char* String) { int Length = strlen(String); for(int i=0; i<Length; i++) { String[i]--; } }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
You could use Huffman code to save the chars ( and then you would be saving file space too ).
If you don't know about Huffman Code just google it.
with your ios::binary, can you give an example?
Stan The Man. Beatles fan
When I was a child,
I spoke as a child,
I thought as a child,
I reasoned as a child.
When I became a man,
I put childish ways behind me"
(the holy bible, Paul, in his first letter to the Cor. 13:11)
Originally posted by Stan100
with your ios::binary, can you give an example?Code:int MyVar = 12345; ofstream WriteFile; WriteFile.open("MyFile.sav", ios::out | ios::binary); if(!WriteFile.fail()) { WriteFile.write((char*)&MyVar, sizeof(int)); WriteFile.close(); }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.