K
K
kokojamba2019-07-17 21:39:42
SQL Server
kokojamba, 2019-07-17 21:39:42

Wrong passwords in MSSQL, how to fix?

There is a task to correct a problem of storage of passwords in MSSQL.
The problem is this, as far as I understand:

declare @hashpswd nvarchar(128)
set @hashpswd=HASHBYTES('SHA2_512', '[email protected]')
select @hashpswd as hashpswd

This code will produce shortcodes instead of a normal hash because HASHBYTES returns varbinary data.
Now the question is, how can I make these shorthands in any scripting language in a readable form as they should be if the hashpswd variable is correctly declared?
This is the type of result you should get -
0x6BFCC4026B5F162799A6DC8305C09DB9C1674AC616BD5C7422A45FBB6D0816AC163047C47A1F426F4F4C6B5B5042C671EABC4FDC7310FD5B183EEF59DC274604 I need an algorithm / way how to convert existing passwords to normal

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kokojamba, 2019-07-17
@kokojamba

I found this solution, tell me if it is correct:

declare @char nvarchar(100) = N'íçöݽÞ÷—\x1dmæº\x7fÞwoÍzÙî¸\x7fn['
select convert(varbinary(max), @char) as resulthash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question