Development ASP.Net Tutorial

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Security.Cryptography" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void Page_Load()
    {
        lblAES.Text = GetSequence(64);
        lblSHA1.Text = GetSequence(128);
    }
    private string GetSequence(int length)
    {
        byte[] buffer = new byte[length/2];
        RNGCryptoServiceProvider provider = new RNGCryptoServiceProvider();
        provider.GetBytes(buffer);
        StringBuilder builder = new StringBuilder(length);
        for (int i = 0; i < buffer.Length; i++)
            builder.Append(string.Format("{0:X2}", buffer[i]));
        return builder.ToString();
    }



    Generate Keys


    
    

    AES:
            id="lblAES"
        Runat="server" />
    
    SHA1:
            id="lblSHA1"
        Runat="server" />