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` gi>ddlmZmZmZmZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZddlmZdd lmZmZe Zed k(r dd lmZmZn#ed k(sed k(rdd lmZmZddlmZmZndd lmZmZgdZej>dk(rdZ dZ!ndZ dZ!ddZ"dZ#y))unicode_literalsdivisionabsolute_importprint_functionN)datetime)backend) rand_bytes) type_namebyte_cls int_types)pretty_message)newderefmac)pbkdf2 pkcs12_kdfwin winlegacy)kernel32 handle_error)pbkdf1rpbkdf2_iteration_calculatorrwin32cxttd}tj|}t|t |S)NzLARGE_INTEGER *)rrQueryPerformanceCounterrr)numberress =/opt/nydus/tmp/pip-target-bkdi07qp/lib/python/oscrypto/kdf.py _get_startr $s1X01..v6SV}c8t|z }t|dz S)Ng@@)r int)startlengths r _get_elapsedr&*s%6F?##r!c*tjS)N)rnowr!rr r /s||~r!ctj|z }|j|jdzdzz}|jdz }t ||dzzS)Nii)rr(secondsdays microsecondsr#)r$r%r, millisecondss rr&r&2sS%'..FKK"$4t$;<++g5 <7W#4566r!c tgdvrttdtt t st tdtdkrttdtt t st tdtdkrttdttjrttdd d jd  t   fd }|}t|z d z |}|z dkrdnd}tt|}|dkDr|dzdz}|S)a Runs pbkdf2() twice to determine the approximate number of iterations to use to hit a desired time per run. Use this on a production machine to dynamically adjust the number of iterations as high as you can. :param hash_algorithm: The string name of the hash algorithm to use: "md5", "sha1", "sha224", "sha256", "sha384", "sha512" :param key_length: The length of the desired key in bytes :param target_ms: The number of milliseconds the derivation should take :param quiet: If no output should be printed as attempts are made :return: An integer number of iterations of PBKDF2 using the specified hash that will take at least target_ms )sha1sha224sha256sha384sha512zz hash_algorithm must be one of "sha1", "sha224", "sha256", "sha384", "sha512", not %s ? key_length must be an integer, not %s rC key_length must be greater than 0 - is %s z> target_ms must be an integer, not %s zB target_ms must be greater than 0 - is %s z Only a very slow, pure-python version of PBKDF2 is available, making this function useless i'zthis is a testzutf-8ct}tt|}std|ddz |zS)Nz iterations in msg?)r rr&print) r$ observed_mshash_algorithm iterations key_lengthpasswordquietsalt target_mss r_measurez-pbkdf2_iteration_calculator.._measuresC ~xz:F"5)  ZE FY,,r!g@ii Ni)set ValueErrorrrepr isinstancer TypeErrorr r pure_pythonOSErrorencoder r#round) r<r>rBr@rCfraction round_factorresultr=r?rAs ```` @@@rrr9s0S!QRR       j) ,  j !    A~        i +  i    1}  O    n    J&&w/H j !D--zHZ(*S01JzHh&J $f,2"L z<0 1F ~D.D( Mr!c t|tsttdt |t|tsttdt |t|t sttdt ||dkrt tdt|t|t sttdt ||dkrt tdt||tgdvrt td t||d kDr/|td d gvr t td |t|f|dkDr#|dk(rt tdt|tt|}|||zj}td|dzD]}||j}|d|S)aF An implementation of PBKDF1 - should only be used for interop with legacy systems, not new architectures :param hash_algorithm: The string name of the hash algorithm to use: "md2", "md5", "sha1" :param password: A byte string of the password to use an input to the KDF :param salt: A cryptographic random byte string :param iterations: The numbers of iterations to use when deriving the key :param key_length: The length of the desired key in bytes :return: The derived key as a byte string z@ password must be a byte string, not %s z< salt must be a byte string, not %s z? iterations must be an integer, not %s rzC iterations must be greater than 0 - is %s r6r7)md2md5r1zT hash_algorithm must be one of "md2", "md5", "sha1", not %s rSrTzM key_length can not be longer than 16 for %s - is %s r1zO key_length can not be longer than 20 for sha1 - is %s N) rIr rJrr r rGrHrFgetattrhashlibdigestrange)r<r?rAr=r>algooutput_s rrrs0 h ) x     dH % t_     j) , z "    A~        j) , z "    A~       S!788      B>S%-@@ T*- .    B>V3        7N +D (T/ " ) ) +F 1j1n %'f$$&' +: r!)dF)$ __future__rrrrsysrYrr utilr _typesr r r _errorsr_ffirr_backend _mac.utilrr _win.util_win._kernel32rr _openssl.util__all__platformr r&rrr)r!rrnsRR 22# 9 u-- (k1-661 <<7 $ 7dNer!