<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EncryptionExample1.aspx.cs" Inherits="Misc.EncryptionExample1" %>

 

<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">

    <title>Encryption Example</title>

    <style type="text/css">

        body { background-color: #ff6c6c; }

        table { border-width: 0; }

        tr { vertical-align: top; }

        .auto-style1 {

            width: 249px;

        }

        .auto-style2 {

            width: 104px;

        }

    </style>

 

</head>

<body>

    <h3>This example demonstrates Encrypting & Decrypting data in ASP.NET Web Applications. <br />

        The password is encrypted and stored in a cookie.</h3>

   

    <form id="form1" runat="server">

       

        <table>

            <tr>

                <td class="auto-style2">Username: </td>

                <td class="auto-style1">

                    <asp:TextBox ID="txtUserName" runat="server" Height="22px" Width="150px" />

                </td>

            </tr>

            <tr>

                <td class="auto-style2">Password: </td>

                <td class="auto-style1">

                    <asp:TextBox ID="txtPassword" runat="server" Height="22px" Width="150px" />

                </td>

            </tr>

            <tr>

                <td class="auto-style2"></td>

                <td class="auto-style1">

                    <asp:Button ID="btnEncrypt" runat="server"

                        Text="Write Encrypted Data to Cookie" Height="27px"

                        Width="250px" OnClick="btnEncrypt_Click" />

                </td>

            </tr>

            <tr>

                <td class="auto-style2"></td>

                <td class="auto-style1">

                    <asp:Button ID="btnDecrypt" runat="server" Text="Read Cookie & Decrypt Data" Height="27px"

                        Width="250px" OnClick="btnDecrypt_Click" />

                </td>

            </tr>

            <tr>

                <td class="auto-style2">

                    <div id="divMethod" runat="server"></div>

                </td>

                <td class="auto-style1">

                    <asp:Label ID="lblDisplay" runat="server" Text="" /></td>

            </tr>

        </table>

       

    </form>

</body>

</html>