Reputation: 2863
I am using RijndaelManaged 128 bit encryption to encrypt passwords in my ASP.NET application. What should the password column size be in the database (SQL Server 2008).
Upvotes: 1
Views: 425
Reputation: 15159
I didn't use RijndaelManaged but basicly encrypting passwords considered bad security practice. Instead it's better to keep their hashes. So the column size depends on the maximum password length and how your hash function works. If it produces unicode characters you need nvarchar
column, if latin only - varchar
will save half of the space in the storage.
Upvotes: 1
Reputation: 64635
Microsoft uses nvarchar(128) for their SqlMembershipProvider which provides for Rijndael symmetrical encryption and a maximum password size of 128, so I would say that's a safe bet. Obviously, if you allow for longer passwords, you'll need more space.
Upvotes: 1