private static Profile FromJson(JSONNode json) { var profile = new Profile { BestScore = ProtectedValue.FromJson(json["BestScore"]), Sound = ProtectedValue.FromJson(json["Sound"]), UnlockedItems = json["UnlockedItems"].Childs.Select(i => i.Value.ToEnum <BallId>()).ToList() }; return(profile); }
public static ProtectedValue Decrypt(ProtectedValue value, ProtectedValue password) { return new ProtectedValue(Decrypt(value.String, password.String)); }
public static ProtectedValue Encrypt(ProtectedValue value, ProtectedValue password) { return new ProtectedValue(Encrypt(Encoding.UTF8.GetBytes(value.String), password.String)); }