In the NET framework of the. NET Framework 4.5, it is convenient to encrypt and decrypt programs. Now we are learning ASP. NET MVC program, so Insus.net also write a learning example here. You can refer to and consult if necessary.
Write a utility class that contains methods for encrypting encryption and decrypting decryption. Of course you can completely customize your encryption and decryption key.
In the ASP. NET MVC demo, enter characters in the text box, point to encrypt the ammonium button, display the encrypted character, point to decrypt the ammonium button, and display the original text.
Add three action to the controller:
Add a view based on the action of tag 1:
Two ammonium button jquery code:
Using JSON for the arguments, the parameter names remain the same as the method parameter names:
The same is true for the returned results:
Demo:
Using encryption and decryption in an ASP. NET MVC Environment