[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?

admin at formationgrowthhacking.com writes:
> 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).

Contact the person responsible for the data in your database.
Ask him which hashing algorithm should be used to verify the
license info provided by a user against the database info.

Note: there are many different hashing functions (e.g. "md5", "sha1",
"sha256", ...) and often their use involves an additionl secret
(besides the hashed data). Best get those details from a
knowledgable person than from us.