Reema
Reema

Reputation: 647

How to hash a password with SHA2-512 in Java?

I have SHA2-512 password encryption set up on my application. While creating users, the password is created using the below method:

DECLARE @salt UNIQUEIDENTIFIER=NEWID(); select
HASHBYTES('SHA2_512','password'+CAST(@salt AS NVARCHAR(36)))

I am now trying to implement this in Java. I see the MessageDigest helps creating SHA-512 but SHA2-512 throws NoSuchAlgorithmException exception.

Any suggestions with appropriate methods of getting this on Java side will be helpful.

Upvotes: 0

Views: 777

Answers (0)

Related Questions