title: SQL-Server Password Encryption
body: <p>I am creating a database for a website I've just developed but I need to encrypt my passwords.</p>
  
  <p>I've never encrypted passwords before and I don't know how to do it, I've searched google and a lot of websites but all they do is confuse me.</p>
  
  <p>Here is my Sproc:</p>
  
  <pre><code>CREATE TABLE USERS(
  Username Nvarchar(200) PRIMARY KEY NOT NULL,
  Password Nvarchar(200) NOT NULL,
  EmailPassword Nvarchar(200) NOT NULL,
  UsernamePassword Nvarchar(200) NOT NULL
  )
  CREATE TABLE Usernames(
  Username Nvarchar(200) FOREIGN KEY(Username) REFERENCES USERS(Username),
  Usernames Nvarchar(300) NOT NULL,
  Description nvarchar(500)
  )
  CREATE TABLE Emails(
  Username Nvarchar(200) FOREIGN KEY(Username) REFERENCES USERS(Username),
  Passwords Nvarchar(300) NOT NULL,
  Description nvarchar(500)
  )
  CREATE TABLE Passwords(
  Username Nvarchar(200) FOREIGN KEY(Username) REFERENCES USERS(Username),
  Usernames Nvarchar(300) NOT NULL,
  Description nvarchar(500)
  )
  </code></pre>
  
  <p>I would like to encrypt the columns that contain NOT NULL accept the username column</p>