Commits

HexRx committed 23b2480

Fixed base64

  • Participants
  • Parent commits d902df9
  • Tags 0.0.4

Comments (0)

Files changed (1)

KPDataSave/AccountState.cs

             ICryptoTransform cryptoTransform = symmetricKey.CreateDecryptor(Encoding.UTF8.GetBytes("hhekhlyshoqxt5s"), 
                 Encoding.UTF8.GetBytes("7movlrmyr1txov5e"));
             string dvalue;
-            using (var memoryStream = new MemoryStream(Convert.FromBase64String(value)))
+            byte[] data;
+            try
+            {
+                data = Convert.FromBase64String(value);
+            }
+            catch (FormatException)
+            {
+                return null;
+            }
+            using (var memoryStream = new MemoryStream(data))
             {
                 using (var cryptoStream = new CryptoStream(memoryStream, cryptoTransform, CryptoStreamMode.Read))
                 {