
December 8th, 2003, 02:43 PM
|
|
Mad Rater
|
|
Join Date: Sep 2003
Posts: 126
  
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
|
|
(a) Any encryption scheme is vulnerable to a dictionary attack. It is basically a brute force technique, so the defence against this is to not use passwords that can be found in a dictionary.
(b) VARBINARY(255) ought to be long enough (at least most of the docs I've seen indicate this).
Be aware though that these functions are undocumented by Microsoft. So they don't have to necessarily support/port them to future versions of SQL Server. Also, the algorithm was changed between SQL Server 6.5 and 7.0, so data encrypted with 6.5's PWDENCRYPT would not equal the password which was compared with 7.0's PWDCOMPARE. This caused programs to break for people who were upgrading their databases from 6.5 to 7.0. Who knows, maybe Microsoft may change the encryption scheme again in the next version of SQL server.
You could always use the front end language (PHP, Perl etc.) to do an MD5 hash and store that into the database. This might be a safer alternative to using an undocumented MS function
More reading: http://www.sqlmag.com/Articles/Index.cfm?ArticleID=9809
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
|