Encryption

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
BFRETHGIL
Posts: 23
Joined: Wed Jun 13, 2018 8:25 pm

Encryption

Post by BFRETHGIL »

Hey there,

So I've been using the encryption option without a problem, but when I open the actual file myFile.txt I can see all my keys and all the names that I have there, does it encrypt only values? I don't want my key names to be readable, is it possible? thanks.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Encryption

Post by Joel »

Hi there,

Tags are not encrypted in Easy Save 2 to improve performance. However, you can encrypt the tags yourself when you provide them as parameters.

For example, the following method can be used to encrypt any string:
public class Tag
{
    public static string Encrypt(string str, string password)
    {
        return (new MoodkieSecurity.AESEncryptor(password, MoodkieSecurity.AESBits.BITS128)).Encrypt(System.Text.Encoding.UTF8.GetBytes(str));
    }
}
ES2.Save(123, "myFile.txt?tag="+Tag.Encrypt("myTag", "myPassword"));
int myInt = ES2.Load<int>("myFile.txt?tag="+Tag.Encrypt("myTag", "myPassword"));
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked