Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23247

Python hashlib.sha512 result not matching with SQL Server HASHBYTES('SHA2_512', password)

$
0
0

The SQL Server table has encrypted password which used HASHBYTES('SHA2_512','password') for encrypting.

I used below python code for encrypting the password but the resulting hash values from SQL Server and the Python code do not match.

import hashlib# String to hashtext = 'Password@12345'# Calculate SHA-512 hashsha512_hash_bytes = hashlib.sha512(text.encode()).digest()# Convert hash bytes to hexadecimal stringsha512_hash_hex = sha512_hash_bytes.hex()

How to match SQL Server HASHBYTES('SHA2_512') result and Python sha512 hashing results?

Please help me on this.


Viewing all articles
Browse latest Browse all 23247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>