Hi All,
I want to do the URL encryption across the application. Please provide some common method to implement the URL encryption/Decryption in C#. How to generate the encryption key randomly for particular session to use for encryption and decryption.
As of now I am generation random encryption key using below code
private static Random random = new Random();
public static string RandomString(int length)
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}
I am not able to keep the key for particular session. Please sombody provide the input on it ASAP.
Thanks in advance
Ambrish