I had a strange security issue, lately I get regular but intermittent errors when trying to insert hashed passwords into the SQL Server database field, which is nvarchar (130):
<cfqueryparam value="#hashpass#" cfsqltype="cf_sql_char" maxLength="130">
The hashpass variable is set this way:
<cfset hashpass = Hash(arguments.password & getsalt.user_salt, "SHA-512")>
Surprisingly, how is it possible for the SHA-512 hash to be longer than 128 characters when the documentation states that it should always be 128 for sure? Here is the ColdFusion 10 error:
[Macromedia] [SQLServer JDBC Driver] [SQLServer] String or binary data will be truncated.
source share