I'm having a weird security-related problem, lately I've been getting regular but intermittent errors when trying to insert hashed passwords in a SQL Server database field that's nvarchar(130):
<cfqueryparam value="#hashpass#" cfsqltype="cf_sql_char" maxLength="130">
The hashpass variable is set thus:
<cfset hashpass = Hash(arguments.password & getsalt.user_salt, "SHA-512")>
Wondering how it's possible for a SHA-512 hash to be longer than 128 characters, when the documentation says it should always be 128 exactly? Here's the ColdFusion 10 error:
[Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.