Encode the plain_password with the salt of the hashed_password.

        Return the comparison with the encrypted_password.
972245
def check_password(self, hashed_password, plain_password):
        
        salt, encrypted_password = hashed_password.split('$')
        re_encrypted_password = self.get_hash(salt, plain_password)
        return encrypted_password == re_encrypted_password
304519
def create_NT_hashed_password_v1(passwd, user=None, domain=None):
    ""
    # if the passwd provided is already a hash, we just return the second half
    if re.match(r'^[\w]{32}:[\w]{32}$', passwd):
        return binascii.unhexlify(passwd.split(':')[1])

    digest = hashlib.new('md4', passwd.encode('utf-16le')).digest()
    return digest
34197
public function encodePassword()
    {
        if (!$this->validate(['password'])) {
            return false;
        }
        
        // create random string for password salting
        $this->password_salt = Yii::$app->getSecurity()->generateRandomString();
        // store the password
        $this->password = Yii::$app->getSecurity()->generatePasswordHash($this->password.$this->password_salt);

        return true;
    }
120720
def encode(self, method, uri):
        ''''''
        if not self.username or not self.password:
            return
        o = self.options
        qop = o.get('qop')
        realm = o.get('realm')
        nonce = o.get('nonce')
        entdig = None
        p_parsed = urlparse(uri)
        path = p_parsed.path
        if p_parsed.query:
            path += '?' + p_parsed.query
        ha1 = self.ha1(realm, self.password)
        ha2 = self.ha2(qop, method, path)
        if qop == 'auth':
            if nonce == self.last_nonce:
                self.nonce_count += 1
            else:
                self.nonce_count = 1
            ncvalue = '%08x' % self.nonce_count
            s = str(self.nonce_count).encode('utf-8')
            s += nonce.encode('utf-8')
            s += time.ctime().encode('utf-8')
            s += os.urandom(8)
            cnonce = sha1(s).hexdigest()[:16]
            noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, ha2)
            respdig = self.KD(ha1, noncebit)
        elif qop is None:
            respdig = self.KD(ha1, "%s:%s" % (nonce, ha2))
        else:
            # XXX handle auth-int.
            return
        base = ('username="%s", realm="%s", nonce="%s", uri="%s", '
                'response="%s"' % (self.username, realm, nonce, path, respdig))
        opaque = o.get('opaque')
        if opaque:
            base += ', opaque="%s"' % opaque
        if entdig:
            base += ', digest="%s"' % entdig
            base += ', algorithm="%s"' % self.algorithm
        if qop:
            base += ', qop=%s, nc=%s, cnonce="%s"' % (qop, ncvalue, cnonce)
        return 'Digest %s' % base
746728
def hmac_md5(s, salt):
        
        hmac_md5 = hmac.new(salt.encode('utf-8'), s.encode('utf-8'),
                            digestmod=hashlib.md5).hexdigest()
        return hmac_md5
728675
def digest_password
      token = nonce + timestamp + password
      Base64.encode64(Digest::SHA1.digest(token)).chomp!
    end
948247
def get_common_password_hash(self, salt):
        
        password = self._password
        if password is None:
            raise SRPException('User password should be in context for this scenario.')

        return self.hash(salt, self.hash(self._user, password, joiner=':'))
485668
public char[] hash(char[] password, byte[] salt) {
    checkNotNull(password);
    checkArgument(password.length != 0);
    checkNotNull(salt);
    checkArgument(salt.length != 0);

    try {
      SecretKeyFactory f = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
      SecretKey key =
          f.generateSecret(new PBEKeySpec(password, salt, ITERATIONS, DESIRED_KEY_LENGTH));
      return Base64.encodeBase64String(key.getEncoded()).toCharArray();
    } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
      throw new IllegalStateException("Could not hash the password of the user.", e);
    }
  }
246348
def _get_passwordkey(self):
        """"""

        sha = SHA256.new()
        sha.update(self.password.encode('utf-8'))
        return sha.digest()
333412
public static String computePasswordHash(final String password, final byte[] salt) {
    if (StringMan.isEmpty(password))
      return (StringMan.encodeBytesToString(salt));
    final KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 2048, 160);
    SecretKeyFactory f;
    try {
      f = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
      final byte[] hash = f.generateSecret(spec).getEncoded();
      return StringMan.encodeBytesToString(hash);
    } catch (final NoSuchAlgorithmException ex) {
      throw new RuntimeException("Missing encryption algorithm:", ex);
    } catch (final InvalidKeySpecException ex) {
      throw new RuntimeException("Key spec is incorrect.", ex);
    }
  }
562230
public String encryptPassword(String plain) {
    Preconditions.checkArgument(this.encryptors.size() > 0,
        "A master password needs to be provided for encrypting passwords.");

    try {
      return this.encryptors.get(0).encrypt(plain);
    } catch (Exception e) {
      throw new RuntimeException("Failed to encrypt password", e);
    }
  }
989179
public static String encrypt(String salt, String password, String plainText) {
        SecretKey secret = getKey(salt, password);
        return encryptBouncyCastle(secret, plainText);
    }
1216976
function (user, password, salt) {
  var inner = md5(password + user)
  var outer = md5(Buffer.concat([Buffer.from(inner), salt]))
  return 'md5' + outer
}
140449
def verify_hash(self, hashed_data, compare_data):
        
        return self.security.hashing_context.verify(
            encode_string(compare_data), hashed_data)
251907
def password_hash(password, password_salt=None):
    """"""
    password_salt = password_salt or oz.settings["session_salt"]
    salted_password = password_salt + password
    return "sha256!%s" % hashlib.sha256(salted_password.encode("utf-8")).hexdigest()
871360
public static String computePasswordHash(final String password, final String salt) {
    return computePasswordHash(password, stringToSalt(salt));
  }
662074
def string(s, salt=None):
        
        m = hashlib.md5()
        s = s.encode('utf-8') + salt.encode('utf-8') if salt is not None else s.encode('utf-8')
        m.update(s)
        result = m.hexdigest()
        return result