Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 2824 |  Welcome, Guest!   Register  Login
  Home > Community Home >

how to store password in encrypted and decrypt them ?

  Posted on: 4/3/2012 7:07:50 AM | Views: 5

Recommend an Articles | Recommended Articles | Search Resources | Community Home |




hello there,
i am very new in SQL. i am creating a website in asp.net. i want to create a login page for administrator to enter new items and prices.
how i can store its password in encrypted form and how i can select and can decrypt when i want to authenticate.
here is my line of code to check valid user.
where UserName and Password are TextBoxes.

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["abcCS"].ConnectionString); 
conn.Open();
string strName = "select count(*) from users where user_id='" + UserName.Text + "' AND user_pass='" + Password.Text + "'"; 
SqlCommand checkUsers = new SqlCommand(strName, conn); 
int temp = Convert.ToInt32(checkUsers.ExecuteScalar().ToString()); 
if (temp == 1) {
Session["userName"] = UserName.Text;
Re ... Go to the complete details ...

Found interesting? Add this to:


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 10:47:28 PM