Decrypting the password

Posted by Self-Innovator under ASP.NET on 3/31/2012 | Points: 10 | Views : 2025 | Status : [Member] | Replies : 2
i've Stored the Password using below st..
string Pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "MD5");

Now how do i decrypt pls some one tell me the GET sp stored proc for this one..

Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Hmanjarawala on: 3/31/2012 [Member] Bronze | Points: 25

Up
0
Down
Will you give me your source code...
i want to see what you have done for encryption then only i can help you....

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 3/31/2012 [Member] Bronze | Points: 25

Up
0
Down
Chek tyhis...
From Front End..
protected void btnSubmit_Click(object sender, EventArgs e)

{
string Uid = txtUserId.Text.Trim();
//string Pwd = txtPassword.Text.Trim();
//System.Text.ASCIIEncoding encryptPwd = new System.Text.ASCIIEncoding();
//byte[] bpwdArray = encryptPwd.GetBytes(Pwd);
string Pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "MD5");
string Name = txtName.Text.Trim();
string DesigCode = txtDesigCode.Text.Trim();
string Email = txtEmail.Text.Trim();
string TelNo = txtTelNo.Text.Trim();
string HandPhNo = txtHandPhone.Text.Trim();
string active = ddlActive.SelectedValue;
try
{
SqlConnection cnn = new SqlConnection(Conn);
SqlCommand cmd = new SqlCommand("spAddUserDetails", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Uid", Uid);
cmd.Parameters.AddWithValue("@Pwd", Pwd);
cmd.Parameters.AddWithValue("@Name", Name);
cmd.Parameters.AddWithValue("@DesigCode", DesigCode);
cmd.Parameters.AddWithValue("@Email", Email);
cmd.Parameters.AddWithValue("@TelNo", TelNo);
cmd.Parameters.AddWithValue("@HandPhNo", HandPhNo);
cmd.Parameters.AddWithValue("@active", active);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ada.Fill(ds);
txtUserId.Text="";
txtPassword.Text = "";
txtName.Text = "";
txtDesigCode.Text = "";
txtEmail.Text = "";
txtTelNo.Text = "";
txtHandPhone.Text = "";
ClientScript.RegisterStartupScript(GetType(), "Message", "<script language='javascript'>alert('Record Inserted Successfully');</script>");
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(GetType(), "Message", "<script language='javascript'>alert('" + ex.Message.ToString() + "');</script>");
}
finally
{
}
}

Insert Sp
USE [Testing]

GO
/****** Object: StoredProcedure [dbo].[spAddUserDetails] Script Date: 03/31/2012 10:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[spAddUserDetails]
@Uid CHAR(4),
@Pwd VARCHAR(40),
@Name VARCHAR(70),
@DesigCode CHAR(3),
@Email VARCHAR(50),
@TelNo VARCHAR(25)=NULL,
@HandPhNo VARCHAR(25)=NULL,
@active bit
AS
BEGIN
INSERT INTO tblUserMst VALUES(@Uid,EncryptByPassPhrase('12',@Pwd),@Name,@DesigCode,@Email,@TelNo,@HandPhNo,@active)

END






Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response