Did I find the right examples for you? yes no

All Samples(7944)  |  Call(7931)  |  Derive(0)  |  Import(13)

src/p/a/packetpig-HEAD/lib/scripts/impacket/impacket/ntlm.py   packetpig(Download)
except Exception:
    try:
        import POW
    except Exception:
        print "Warning: You don't have any crypto installed. You need either POW or PyCrypto"
def __DES_block(key, msg):
    if POW:
        cipher = POW.Symmetric(POW.DES_ECB)
        cipher.encryptInit(__expand_DES_key(key))
        return cipher.update(msg)
def generateSessionKeyV1(password, lmhash, nthash):
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)
    else:        
        hash = MD4.new()
def compute_nthash(password):
    # This is done according to Samba's encryption specification (docs/html/ENCRYPTION.html)
    password = unicode(password).encode('utf_16le')
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)
def generateEncryptedSessionKey(keyExchangeKey, exportedSessionKey):
   if POW:
       cipher = POW.Symmetric(POW.RC4)
       cipher.encryptInit(keyExchangeKey)
       cipher_encrypt = cipher.update

src/i/m/impacket-0.9.11/impacket/ntlm.py   impacket(Download)
except Exception:
    try:
        import POW
    except Exception:
        print "Warning: You don't have any crypto installed. You need either POW or PyCrypto"
def __DES_block(key, msg):
    if POW:
        cipher = POW.Symmetric(POW.DES_ECB)
        cipher.encryptInit(__expand_DES_key(key))
        return cipher.update(msg)
def generateSessionKeyV1(password, lmhash, nthash):
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)
    else:        
        hash = MD4.new()
def compute_nthash(password):
    # This is done according to Samba's encryption specification (docs/html/ENCRYPTION.html)
    password = unicode(password).encode('utf_16le')
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)
def generateEncryptedSessionKey(keyExchangeKey, exportedSessionKey):
   if POW:
       cipher = POW.Symmetric(POW.RC4)
       cipher.encryptInit(keyExchangeKey)
       cipher_encrypt = cipher.update

src/r/a/raspberry_pwn-HEAD/src/pentest/voiper/sulley/impacket/smb.py   raspberry_pwn(Download)
    def hmac_md5(self, key, data):
        import POW
        h = POW.Hmac(POW.MD5_DIGEST, key)
        h.update(data)
        result = h.mac()

src/r/a/raspberry_pwn-HEAD/src/pentest/voiper/sulley/impacket/ntlm.py   raspberry_pwn(Download)
except Exception:
    try:
        import POW
    except Exception:
        pass
def __DES_block(key, msg):
    if POW:
        cipher = POW.Symmetric(POW.DES_ECB)
        cipher.encryptInit(__expand_DES_key(key))
        return cipher.update(msg)
def compute_nthash(password):
    # This is done according to Samba's encryption specification (docs/html/ENCRYPTION.html)
    password = unicode(password).encode('utf_16le')
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)

src/r/a/raspberry_pwn-HEAD/src/pentest/voiper/sulley/impacket/dcerpc/dcerpc.py   raspberry_pwn(Download)
except Exception:
    try:
        import POW
    except Exception:
        print "WARNING: Crypto package not found. Some features will fail."
                if self.__password:
                    key = ntlm.compute_nthash(self.__password)
                    if POW:
                        hash = POW.Digest(POW.MD4_DIGEST)
                    else:
                    key = '\x00'*16
 
            if POW:
                cipher = POW.Symmetric(POW.RC4)
                cipher.encryptInit(key)
                session_key = 'A'*16     # XXX Generate random session key
                response['session_key'] = self.cipher_encrypt(session_key)
                if POW:
                    cipher = POW.Symmetric(POW.RC4)
                    cipher.encryptInit(session_key)

src/p/w/PwnBerryPi-HEAD/src/pentest/voip/voiper/sulley/impacket/smb.py   PwnBerryPi(Download)
    def hmac_md5(self, key, data):
        import POW
        h = POW.Hmac(POW.MD5_DIGEST, key)
        h.update(data)
        result = h.mac()

src/p/w/PwnBerryPi-HEAD/src/pentest/voip/voiper/sulley/impacket/ntlm.py   PwnBerryPi(Download)
except Exception:
    try:
        import POW
    except Exception:
        pass
def __DES_block(key, msg):
    if POW:
        cipher = POW.Symmetric(POW.DES_ECB)
        cipher.encryptInit(__expand_DES_key(key))
        return cipher.update(msg)
def compute_nthash(password):
    # This is done according to Samba's encryption specification (docs/html/ENCRYPTION.html)
    password = unicode(password).encode('utf_16le')
    if POW:
        hash = POW.Digest(POW.MD4_DIGEST)

src/p/w/PwnBerryPi-HEAD/src/pentest/voip/voiper/sulley/impacket/dcerpc/dcerpc.py   PwnBerryPi(Download)
except Exception:
    try:
        import POW
    except Exception:
        print "WARNING: Crypto package not found. Some features will fail."
                if self.__password:
                    key = ntlm.compute_nthash(self.__password)
                    if POW:
                        hash = POW.Digest(POW.MD4_DIGEST)
                    else:
                    key = '\x00'*16
 
            if POW:
                cipher = POW.Symmetric(POW.RC4)
                cipher.encryptInit(key)
                session_key = 'A'*16     # XXX Generate random session key
                response['session_key'] = self.cipher_encrypt(session_key)
                if POW:
                    cipher = POW.Symmetric(POW.RC4)
                    cipher.encryptInit(session_key)