PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  ]c@sldZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZddlmZyejZeZWn0ek rddlZejdeZnXdd Zd d d Zeed rdZn dZdZdZeedrYdddZndddZdS(u3 Django's standard crypto functions and utilities. i(tunicode_literalsN(tsettings(tsix(t force_bytes(trangeujA secure pseudo-random number generator is not available on your system. Falling back to Mersenne Twister.cCsk|dkrtj}nt|}t|}tj||j}tj|dt|dtjS(u Returns the HMAC-SHA1 of 'value', using a key generated from key_salt and a secret (which defaults to settings.SECRET_KEY). A different key_salt should be passed in for every application of HMAC. tmsgt digestmodN( tNoneRt SECRET_KEYRthashlibtsha1tdigestthmactnew(tkey_salttvaluetsecrettkey((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyt salted_hmacs     i u>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789csmtsJtjtjdtjtjtjfj dj ndj fdt |DS(u Returns a securely generated random string. The default length of 12 with the a-z, A-Z, 0-9 character set returns a 71-bit value. log_2((26+26+10)^12) =~ 71 bits u%s%s%suutf-8uc3s|]}tjVqdS(N(trandomtchoice(t.0ti(t allowed_chars(s7/usr/lib/python2.7/site-packages/django/utils/crypto.pys Ms( tusing_sysrandomRtseedR tsha256tgetstatettimeRRtencodeR tjoinR(tlengthR((Rs7/usr/lib/python2.7/site-packages/django/utils/crypto.pytget_random_string6s   #ucompare_digestcCstjt|t|S(N(R tcompare_digestR(tval1tval2((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pytconstant_time_compareRscCst|t|krtSd}tjrzt|trzt|trzxht||D]\}}|||AO}qYWn:x7t||D]&\}}|t|t|AO}qW|dkS(u Returns True if the two strings are equal, False otherwise. The time taken is independent of the number of characters that match. For the sake of simplicity, this function executes in constant time only when the two strings have the same length. It short-circuits when they have different lengths. Since Django only uses it to compare hashes of known expected length, this is acceptable. i(tlentFalseRtPY3t isinstancetbytestziptord(R"R#tresulttxty((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyR$Us 'cCsttj|dS(uq Convert a binary string into a long integer This is a clever optimization for fast xor vector math i(tinttbinasciithexlify(R-((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyt _bin_to_longlscCstj||jdS(uw Convert a long integer into a binary string. hex_format_string is like "%020x" for padding 10 characters. uascii(R0t unhexlifyR(R-thex_format_string((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyt _long_to_binusu pbkdf2_hmacicCs^|dkrtj}n|s'd}nt|}t|}tj|j||||S(u Implements PBKDF2 with the same API as Django's existing implementation, using the stdlib. This is used in Python 2.7.8+ and 3.4+. N(RR RRt pbkdf2_hmactname(tpasswordtsaltt iterationstdklenR ((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pytpbkdf2~s     c sdkst|s$tj}nt|}t|j}|sW|}n|d |krvtdn| | }||d|}d|d||t|jkr||j}n|djt|7}j |j t j j |j t j fd}gtd|D]} || ^qW} d j| ||| S( u Implements PBKDF2 as defined in RFC 2898, section 5.2 HMAC+SHA256 is used as the default pseudo random function. As of 2014, 100,000 iterations was the recommended default which took 100ms on a 2.7Ghz Intel i7 with an optimized implementation. This is probably the bare minimum for security given 1000 iterations was recommended in 2001. This code is very well optimized for CPython and is about five times slower than OpenSSL's implementation. Look in django.contrib.auth.hashers for the present default, it is lower than the recommended 100,000 because of the performance difference between this and an optimized implementation. iii iu dklen too bigu%%0%ixtcstjd|}d}xottD][}jj}}|j||j|j|j}|t|N}q/Wt|S(Ns>Ii( tstructtpackRR/tcopytupdateR R2R5(RtuR,tjtdig1tdig2(R4tinnerR:touterR9(s7/usr/lib/python2.7/site-packages/django/utils/crypto.pytFs  tII(tAssertionErrorR RRt digest_sizet OverflowErrorR%t block_sizeR RAt translateR ttrans_36ttrans_5CRR( R8R9R:R;R thlentLtrRHR-tT((R4RFR:RGR9s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyR<s,       (( t__doc__t __future__RR0R R RR>Rt django.confRt django.utilsRtdjango.utils.encodingRtdjango.utils.six.movesRt SystemRandomtTrueRtNotImplementedErrortwarningstwarnR&RRR thasattrR$R2R5R<(((s7/usr/lib/python2.7/site-packages/django/utils/crypto.pyts: