json - Obfuscation for Asp MVC using SmartAssembly or CryptoObfuscator -
i have question in using cryptoobfuscator or redgate smartassembly obfuscate asp mvc assemblies :
it seems when use 1 of these tools obfuscate assemblies, rename properties of classes, right?
so think because of operation lose access of values in json format comes server during serialization ( mean because of renaming properties cant parse json object in js correctly)
if true, how can prevent loosing parsejson operation in js?
let me include more details :
consider class structure
public class myclass { public string fname{get;set;} . . . } //samplecontroller : public jsonresult getjson() { return json(new myclass{fname = "alex"}); }
now in clientside :
$.ajax({ url: "/sample/getjson", context: document.body }).success(function(data) { //this problem : can access fname or not? var fname = jquery.parsejson(data).fname; });
basically obfuscators do not change return value's property's names
.
if obfuscator so... can accomplish using following in ajax call:
$.ajax({ url: "/sample/getjson", datatype: "json" success: function(data) { var transformeddata = {fname:arguments[0], somethingelse:arguments[1]}; //or var fname = arguments[0]; //do rest here... } });
you can use [donotobfuscate] attribute in "smart assembly" using this, can prevent json results being obfuscated @ (on server side).
there should (other/same) strategies other obfuscators.
use cryptoobfuscator
, has options prevent (what/where) ever you'd being obfuscated.
Comments
Post a Comment