Beispiel #1
0
 public static void SetStringEncrypt(string key, string value)
 {
     if (value == null)
     {
         PlayerPrefs.SetString(DESUtil.Encrypt(key, sKey), value);
     }
     else
     {
         PlayerPrefs.SetString(DESUtil.Encrypt(key, sKey), DESUtil.Encrypt(value, sKey));
     }
 }
Beispiel #2
0
        public static string GetStringDecrypt(string key, string defaultValue)
        {
            string value = null;

            if (defaultValue == null)
            {
                value = PlayerPrefs.GetString(DESUtil.Encrypt(key, sKey), defaultValue);
            }
            else
            {
                value = PlayerPrefs.GetString(DESUtil.Encrypt(key, sKey), DESUtil.Encrypt(defaultValue, sKey));
            }


            if (value == null)
            {
                return(value);
            }

            return(DESUtil.Decrypt(value, sKey));
        }
Beispiel #3
0
 public static bool HasKeyEncrypt(string key)
 {
     return(PlayerPrefs.HasKey(DESUtil.Encrypt(key, sKey)));
 }
Beispiel #4
0
 public static void DeleteKeyEncrypt(string key)
 {
     PlayerPrefs.DeleteKey(DESUtil.Encrypt(key, sKey));
 }
Beispiel #5
0
 public static bool WriteEncrypt(string filePath, byte[] data)
 {
     return(Write(filePath, DESUtil.Encrypt(data, sKey)));
 }