StevieB
StevieB

Reputation: 6523

SQL Server 2008 what DataType to store a hashpassword in

I am currently building a login process and decided to store my user password in database with a hashpassword combined with a salt. Just wondering what datatypes to store the hashpassword and salt is Varchar or NVarchar sufficient ?

EDIT : Link where I am basing this on storing passwords in SQL Server

Upvotes: 3

Views: 5047

Answers (3)

Paul Sasik
Paul Sasik

Reputation: 81429

The hash of your passwords should be of uniform string length and represented as either hex or base64 text (or some other, single-byte-per-character representation.)

EDIT (You just need the char type per the uniform length of hash output!)

So char will suffice.

Upvotes: 2

Muhammad Akhtar
Muhammad Akhtar

Reputation: 52241

Microsoft use Nvarchar in when we use SQL membership, have a look the below image

enter image description here

Upvotes: 4

Teddy
Teddy

Reputation: 18572

use the varchar datatype

-- blah blah blah --

I need 30 characters to post a reply

Upvotes: 1

Related Questions