Click here to Skip to main content
15,881,843 members
Articles / Security

Beginners guide to a secure way of storing passwords

Rate me:
Please Sign up or sign in to vote.
4.91/5 (81 votes)
20 Jul 2012CPOL7 min read 229.2K   2.1K   123  
This article will explain how to securely store users passwords in a database.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HowToSecurePasswordInDatabaseArticle
{
    public partial class AddUser : System.Web.UI.Page
    {
        protected void btnAddUser_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            bool result = UserDatabase.AddUser(username, password);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Aurum AS
Norway Norway
Microsoft Certified Solutions Developer (MCSD)

Personal website:
stian.net

My projects:
CRM1.no - A free to use norwegian crm software
Fakturax - A free to use norwegian invoice software
Timeføring.no - A free to use norwegian timereg software
MittUtlegg - A free to use norwegian software for receipts
SupportWeb - A free to use norwegian software customersupport

Comments and Discussions