Skip to main content
nikos101
Inspiring
May 22, 2009
Question

md5 hashing to store passwords with ms sql

  • May 22, 2009
  • 1 reply
  • 961 views

When using md5 hashing to store passwords with ms mql everything works fine with alpha numeric values except space characters, which don't work when the user types in the password in the flex app, an unmatching m5d checksum is therefore being produced when space characters are in the password client side and passed to coldfusion and then to ms sql

    <cfquery name="q" datasource="#d#">
                select     * from     USERS
            where userName = <cfqueryparam value="#arguments.value#" cfsqltype="cf_sql_varchar">
            AND password =  HashBytes('MD5', <cfqueryparam value="#arguments.password#" cfsqltype="cf_sql_varchar">

any ideas?

This topic has been closed for replies.

1 reply

nikos101
nikos101Author
Inspiring
May 22, 2009

Another weird thing I see ms sql Management studio is if I do the following:

SELECT TOP 1password
  FROM [USERS]
 
SELECT  HashBytes('MD5', 'ignore17832')

the two rows are:

Z ^‹&#157;@á2—€Ö.¢&]Š

0xF273CA388B7E8267FCE4827D479853CE

confusing

why is one a hex and the other the weird stuff