encrypt json property convert object to string gson code example Example: how to convert object in string JSON c# var json = new JavaScriptSerializer().Serialize(obj);