In my MVC application i want to encrypt and decrypt data in data transmission from view to Controller . How to do this in MVC 4 using Razor ?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- “Zero out” sensitive String data in Swift
- High cost encryption but less cost decryption
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
- decrypt TLS 1.2 AES-GCM packet
based on this comment: "suppose i am sending an id from my view to my controller and i want to encrypt this id ?"
if you want to encrypt the "id" in a view, in this case you already have the "id" in the view, "id" would be generated in the database or other but not in the client.
In this case, you can encrypt the "id" after put it on the client, and then the controller decrypt only the "id".
Here you have an example that encrypts only the "id", this is done for security so that data is not looking for "id".
In this case you have to encrypt and decrypt the property:
https://stackoverflow.com/a/14774470/138071
http://amitpatelit.com/2011/08/08/url-encryption-in-mvc-application/
In this example (in Spanish) does for all parameters that are received with an underscore (_):
http://geeks.ms/blogs/etomas/archive/2012/07/08/asp-net-mvc-encriptar-routevalues.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+BurbujasNetGeeks+%28Burbujas+en+.NET+%28%40geeks.ms%29%29
You don't need to encrypt data from the controller to the view since the view rendering happens in the same computer that the controller is operating.
If you want to encrypt the page that is sent to the user you should use a ssl connection