Thursday, 22 August 2013

Encrypt data passed in View Model

Encrypt data passed in View Model

I have a simple method in a MVC controler that checks whether the
ModelState is valid then calls another method passing an instance of the
model as a paramter. This model contains sensitive data that is easily
obtasensitive data. My goal is to somehow mask or encrypt this data so
that it is not visible through Fiddler.
This is what the code looks like:
[HttpPost]
[ActionName("Search")]
[AccessControl(Xri)]
public ActionResult SearchPost(string string1, SearchViewModel model)
{
model.NoResults = false;
if (ModelState.IsValid)
{
if (ModelState.IsValid) return RedirectToAction("TargetMethod",
model);
}
}
[AccessControl(Xri)]
public ActionResult TargetMethod(string planShortName, SearchViewModel
viewModel)
{
.
.
.
}
Fiddler shows the following:
/referrals?id=5456464&date=08%2F14%2F2013%2000%3A00%3A00&To=08%2F21%2F2013%2000%3A00%3A00&param1=somevalue&param2=somevalue2

No comments:

Post a Comment