ó DÑÕfc@s†dZdZeeƒZeeƒZeZedZd „Zd ed„Z y.ddl Z e Z eZ ej e jƒZWnek r‚nXxUeD]MZye eƒeƒe>> import hashlib >>> m = hashlib.md5() >>> m.update("Nobody inspects") >>> m.update(" the spammish repetition") >>> m.digest() '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' More condensed: >>> hashlib.sha224("Nobody inspects the spammish repetition").hexdigest() 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' tmd5tsha1tsha224tsha256tsha384tsha512tnewtalgorithms_guaranteedtalgorithms_availablet algorithmst pbkdf2_hmaccCsIy(ttd|ƒ}|dtƒ|SWnttfk rD‚nXdS(Ntopenssl_tusedforsecurity(tgetattrt_hashlibtFalsetAttributeErrort ValueError(tnametf((s/usr/lib64/python2.7/hashlib.pyt__get_openssl_constructorYs  tcCs2ytj|||ƒSWntk r-‚nXdS(sãnew(name, string='') - Return a new hashing object using the named algorithm; optionally initialized with a string. Override 'usedforsecurity' to False when using for non-security purposes in a FIPS environment N(RRR(RtstringR ((s/usr/lib64/python2.7/hashlib.pyt __hash_newhs iÿÿÿÿNscode for hash %s was not found.(R ccs|]}t|dAƒVqdS(i\N(tchr(t.0tx((s/usr/lib64/python2.7/hashlib.pys siccs|]}t|dAƒVqdS(i6N(R(RR((s/usr/lib64/python2.7/hashlib.pys ŽscCsCt|tƒst|ƒ‚nt|ttfƒsHtt|ƒƒ}nt|ttfƒsrtt|ƒƒ}nt|ƒ}t|ƒ}t|ddƒ}t|ƒ|krÆt||ƒj ƒ}n|d|t|ƒ}|j |j t ƒƒ|j |j t ƒƒ||d„}|dkr4t|ƒ‚n|d krL|j}n|dkrgt|ƒ‚ndt|ƒjd} d} d} x®t| ƒ|kr:||tjd | ƒƒ} ttj| ƒd ƒ} x@t|dƒD].}|| ƒ} | ttj| ƒd ƒN} qäW| d7} | tj| | ƒ7} qW| | S( sóPassword based key derivation function 2 (PKCS #5 v2.0) This Python implementations based on the hmac module about as fast as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster for long passwords. t block_sizei@tcSsB|jƒ}|jƒ}|j|ƒ|j|jƒƒ|jƒS(N(tcopytupdatetdigest(tmsgtinnertouterticpytocpy((s/usr/lib64/python2.7/hashlib.pytprf©s    is%%0%ixiRs>IiN(t isinstancetstrt TypeErrortbytest bytearraytbufferRR tlenRRt translatet _trans_36t _trans_5CRtNonet digest_sizetstructtpacktinttbinasciithexlifytxranget unhexlify(t hash_nametpasswordtsaltt iterationstdklenR!R"t blocksizeR%thex_format_stringtdkeytlooptprevtrkeyti((s/usr/lib64/python2.7/hashlib.pyR sB         (RRRRRR(snewsalgorithms_guaranteedsalgorithms_availables algorithmss pbkdf2_hmac(t__doc__t__always_supportedtsetRRR t__all__RtTrueRRRt __get_hashtuniontopenssl_md_meth_namest ImportErrort __func_nametglobalsRtloggingt exceptionR R5R2tjointrangeR/R.R0(((s/usr/lib64/python2.7/hashlib.pytIsB            9