MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.126
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python2.7/site-packages/pyzor/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python2.7/site-packages/pyzor/account.pyc
�
YF�Tc@s�dZddlZddlZddlZejd�Zejd�Zd�Zdefd��YZ	d�Z
e	ejdd	�Z
dS(
s�A collection of utilities that facilitate working with Pyzor accounts.

Note that accounts are not necessary (on the client or server), as an
"anonymous" account always exists.i����NcCsm|j�j�jd�}|�}|j||�j��|jd||fjd��|j�j�S(s�Converts the key, timestamp (epoch seconds), and msg into a digest.

    lower(H(H(M) + ':' T + ':' + K))
    M is message
    T is integer epoch timestamp
    K is hashed_key
    H is the hash function (currently SHA1)
    tutf8s:%d:%s(t	as_stringtstriptencodetupdatetdigestt	hexdigesttlower(t
hashed_keyt	timestamptmsgthash_R((s1/usr/lib/python2.7/site-packages/pyzor/account.pytsign_msgs
		 cCs5d||j�fjd�}||�j�j�S(s�Returns the hash key for this username and password.

    lower(H(U + ':' + lower(K)))
    K is key (hex string)
    U is username
    H is the hash function (currently SHA1)
    s%s:%sR(RRR(tkeytuserRtresult((s1/usr/lib/python2.7/site-packages/pyzor/account.pythash_keyscCs�t|d�}|d}|d}ttj�|�tjkrUtjd��nt||�}|d=t|||�}||kr�tjd��ndS(sVerify that the provided message is correctly signed.

    The message must have "User", "Time", and "Sig" headers.

    If the signature is valid, then the function returns normally.
    If the signature is not valid, then a pyzor.SignatureError() exception
    is raised.tTimetUsertSigs#Timestamp not within allowed range.sInvalid signature.N(tinttabsttimetpyzortMAX_TIMESTAMP_DIFFERENCEtSignatureErrorRR(R
tuser_keyR	Rtprovided_signaturethashed_user_keytcorrect_signature((s1/usr/lib/python2.7/site-packages/pyzor/account.pytverify_signature(s

tAccountcBseZd�ZRS(cCs||_||_||_dS(N(tusernametsaltR
(tselfR R!R
((s1/usr/lib/python2.7/site-packages/pyzor/account.pyt__init__@s		(t__name__t
__module__R#(((s1/usr/lib/python2.7/site-packages/pyzor/account.pyR?scCsCy|jd�\}}Wntk
r8td��nX||fS(Nt,sdInvalid number of parts for key; perhaps you forgot the comma at the beginning for the salt divider?(tsplitt
ValueError(tsR!R
((s1/usr/lib/python2.7/site-packages/pyzor/account.pytkey_from_hexstrFs

t(t__doc__RthashlibRtsha1RRRtobjectRR*tanonymous_usertNonetAnonymousAccount(((s1/usr/lib/python2.7/site-packages/pyzor/account.pyt<module>s			

MMCT - 2023