Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to Decrypt a pbkdf2_hmac and SHA256 Encrypted String Stored in Database?

ps='1024'
salt=b'>}\x1a\xd5\xd3\x9d\x080'
a=hashlib.pbkdf2_hmac('sha256',ps.encode('utf-8'),salt,100000)
print(a)

# this is the output
a=b'\xfeI\x8f.6\xd8A1\x9aOMIB&\x81>\xd6t\xe3\xb1\xa2\xb2\xfen\xd9\x03\x84l\xf6q\xc2\xb8'

How Can I get the value back ‘1024’ i.e from a to ps again?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

you can’t decrypt a sha256 hashed String (that’s what it is used for) you can only hash (and salt) another string and check if the hashes match (then you know the same string was input).

The only way to get the original string is to brute force it with something like hashcat.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading