I am trying to replicate a web application built in php. I noticed in the password field it is encypted as
e.g 'ggdj7d56hsvfsyjsuy7eijyyebtgdtd' and when i created my password i used 'amazing' as the password and in the databse it is '827ccb0eea8a706c4c34a16891f84e7b'.
How did they do it that the password 'amazing' i entered in thet Textbox was saved as '827ccb0eea8a706c4c34a16891f84e7b' in the database.
Please help .
My code
<table style="width: 40%; margin-top: 17px;">
<tr>
<td class="style1"> </td>
<td>
<asp:TextBox ID="TextBox3" runat="server" Width="197px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1"> </td>
<td>
<asp:TextBox ID="TextBox4" runat="server" Width="197px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1"> </td>
<td>
<asp:DropDownList ID="DropDownList2" runat="server" Height="28px" Width="196px">
<asp:ListItem Value="1">Super User</asp:ListItem>
<asp:ListItem Value="2">Mid Users</asp:ListItem>
<asp:ListItem Value="5">Entry Users</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style1"> </td>
<td>
<asp:Button ID="Button3" runat="server" OnClick="Button1_Click"
Text="Create Password" Width="198px" />
</td>
</tr>
</table>
<div align="center">
<asp:Label ID="Label2" runat="server"></asp:Label>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class Atq : System.Web.UI.Page
{
SqlCommand cmd99 = new SqlCommand();
SqlConnection conn99 = new SqlConnection();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string insertSQL99;
insertSQL99 = "INSERT INTO users (";
insertSQL99 += "username,password,privilege)";
insertSQL99 += "VALUES('";
insertSQL99 += TextBox1.Text + "','";
insertSQL99 += TextBox2.Text + "','";
insertSQL99 += DropDownList1.SelectedValue.ToString() + "')";
String connectionString99 = "Data Source=NERE\\SQLEXPRESS01; Initial Catalog= kaging;Integrated Security=True";
SqlConnection con99 = new SqlConnection(connectionString99);
SqlCommand cmd99 = new SqlCommand(insertSQL99, con99);
int added99 = 0;
try
{
con99.Open();
added99 = cmd99.ExecuteNonQuery();
// Label007.Text = added.ToString();
if (added99 == 1)
{
Label1.Text = "Done";
}
else
{
}
}
catch (Exception err)
{
Response.Write(err.ToString());
}
finally
{
con99.Close();
}
}
}