Skip to content

Commit

Permalink
made encryption codeword customisable
Browse files Browse the repository at this point in the history
  • Loading branch information
richardelms committed Dec 6, 2017
1 parent f3796ba commit 40921a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Plugins/FileBasedPrefs/FileBasedPrefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public static class FileBasedPrefs
{
private const string SaveFileName = "saveData.txt";
private const bool ScrambleSaveData = true;
private const string EncryptionCodeword = "CHANGE ME TO YOUR OWN RANDOM STRING";
private const bool AutoSaveData = true;
private static FileBasedPrefsSaveFileModel _latestData;

Expand Down Expand Up @@ -225,11 +226,10 @@ private static void CreateNewSaveFile()

static string DataScrambler(string data)
{
string codeword = "enteryourowncodeifyoulike";
string res = "";
for (int i = 0; i<data.Length; i++)
{
res += (char) (data[i] ^ codeword[i % codeword.Length]);
res += (char) (data[i] ^ EncryptionCodeword[i % EncryptionCodeword.Length]);
}
return res;
}
Expand Down

0 comments on commit 40921a8

Please sign in to comment.