Search code examples
securityzen-cartpassword-storage

How are zencart passwords encrypted in Sql Server?


I have set up a zencart on my web server and the passwords for admin functions are encrypted (or obfuscated in some way) in the sql database associated with zencart - can anyone tell me the extent of this encryption? I want to know if someone who managed to get hold of the database would be able to get access to the data in the password section of the database or whether I would be protected against that specific part of the data becoming public by its encryption.

If it is encrypted, how is it encrypted and how easily can they decrypt it?

It is a default zen cart set up.

Kind regards


Solution

  • Passwords in ZenCart are stored as MD5 hash created for a salt + password. The format stored in the SQL database is MD5Hash:Salt.

    Salting the password before creating the hash prevents users with access to the user table from reverse engeneering the password with help from rainbow tables. So, you are secure, but it could be better if a SHA-2 algorithm was used.

    With PHP you can create data for storage with this code:

    $hashedPassword = md5($salt.$password).':'.$salt;