'Using ASP.net PasswordHash in Django for authentication

I have a database created by someone using C# .Netframework and now I need to create API using Django and connect this API to the same database. But I can't compare PasswordHash created by .Net with CreateAsync function.

I have already researched how CreateAsync works this was very helpful and I tried with Python to get the same hash, but I failed. Can someone help me?

python code

import base64
import hashlib


PassHash = "AQAAAAEAACcQAAAAEJa4CYSXaNB9U7+mWQYqg1GcO/tWRlrvqvBwGWEl/0W7tNKcxTOVUjeBq8OoYWsCEA=="
bytes = base64.b64decode(PassHash)
salt=bytes[0x0E:0x1E] # bytes from 14 to 29
hash=bytes[0x1E:0x3D].hex() # bytes from 30 to 61

password = "hello world" #this pass in not real 
password = password.encode()
password_hash = hashlib.pbkdf2_hmac("SHA256", salt,password,10000)
print(password_hash.hex())


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source