Exemple #1
0
    def decryptWithHash(self, pwdhash):
        """Decrypts this credhist entry with the given user's password hash.
        Simply computes the encryption key with the given hash then calls
        self.decryptWithKey() to finish the decryption.

        """
        self.decryptWithKey(crypto.derivePwdHash(pwdhash, str(self.userSID)))
Exemple #2
0
    def decryptWithPassword(self, userSID, pwd):
        """Decrypts the masterkey with the given user's password and SID.
        Simply computes the corresponding key, then calls self.decryptWithKey()

        """
        for algo in ["sha1", "md4"]:
            self.decryptWithKey(
                crypto.derivePwdHash(
                    hashlib.new(algo, pwd.encode("UTF-16LE")).digest(),
                    userSID))
            if self.decrypted:
                break
Exemple #3
0
    def decryptWithHash(self, userSID, pwdhash):
        """Decrypts the masterkey with the given user's hash and SID.
        Simply computes the corresponding key then calls self.decryptWithKey()

        """
        self.decryptWithKey(crypto.derivePwdHash(pwdhash, userSID))