What is the format of a Magento 2 password? For example:


Is it (salt + password):salt:1 ? Because I've tried creating a SHA256 hashed password through a python function with that format, but it doesn't work.


This is the method that hashes a password:

public function getHash($password, $salt = false, $version = self::HASH_VERSION_LATEST)
    if ($salt === false) {
        return $this->hash($password);
    if ($salt === true) {
        $salt = self::DEFAULT_SALT_LENGTH;
    if (is_integer($salt)) {
        $salt = $this->random->getRandomString($salt);
    return implode(
            $this->hash($salt . $password),

Where $this->hash is this:

public function hash($data, $version = self::HASH_VERSION_LATEST)
    return hash($this->hashVersionMap[$version], $data);

For customers the version parameter is not specified so it will use sha256

So 0504c745003c3d3e7ddc542ae510e1122b7e351435fbdc2986587f9ef295d6af:pfcFuoTL2qienx37PGFHOhWYoXEQwyxo:1 means

  • 0504c745003c3d3e7ddc542ae510e1122b7e351435fbdc2986587f9ef295d6af - sha256(salt + password)
  • pfcFuoTL2qienx37PGFHOhWYoXEQwyxo - salt
  • 1 . encryption method from the \Magento\Framework\Encryption\Encryptor which is sha256

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.