How it works...

We can use the Encrypt() method and get the encrypted value of the provided text. This is a two-way process, so we can get a decrypted value of encrypted text.

ASP.NET Core also has built-in classes to encrypt and decrypt the given data, with different algorithms. Encryption is a two-way operation, and the provided data can be calculated after it has been encrypted using decryption operations with the same algorithm as the encryption.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.