79726679

Date: 2025-08-05 23:50:49
Score: 1
Natty:
Report link

SOLUTION

The biggest hurdle here was SQL Server's encoding of nvarchar utf16le. The following SQL statements retrieve the record:

Original in SQL Server

SELECT * FROM mytable
WHERE (IDField = 'myID') AND (PasswordField = HASHBYTES('SHA2_512', 'myPass' + CAST(SaltField AS nvarchar(36))))

Equivalent in MYSQL

SELECT * FROM mydatabase.mytable
WHERE (IDField = 'myID') AND HEX(PasswordField) = SHA2(CONCAT('myPass', CAST(SaltField AS Char(36) CHARACTER SET utf16le)),512)

Thank you to those who helped me get this over the line. I really appreciate your time and expertise.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user31207162