codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to compare in python an input value with an hashed value in mysql table?


I have a wordpress 5.3 websites which sell a software with license key.

The license key is encrypted and stored in Mysql table. there are 2 columns "license" and "hash":

license_key                                           
def50200352f5dc4bd8181a9daebbf4f9177fe725111a5a479d64636d01c2a10074e0c645abe898dea18210af563a5334288420551ab61c18ca4506cd03aa5d2bdd40933ddf7ca4d4b61b1c0f58a3830cbe0891cf4ff526311d5d637a55a574eca2c3a1b487b56

hash
9498cbf8bf00d6c55e31f98ba6d8294afa3127a84f31aa622c4158ac7377c6dd


My python program get an input for user (the license key in string without any encrypton) and need to compare it with the official license key stored in Mysql database of our Wordpress website.

I read a lot of hashlib python, functions and methods. But I didn't find anywhere how could I "hash" the string input typed by user with some hash values from the table, in order to compare both values (the input license and the license stored in mysql table).


This topic https://stackoverflow.com/questions/1183161/to-sha512-hash-a-password-in-mysql-database-by-python  gave me a lot of information but didn't fix my issue.

Anyone has any idea how to proceed?

Thanks