DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files/MySQL/MySQL Workbench 6.3 CE/python/site-packages/ecdsa/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Program Files/MySQL/MySQL Workbench 6.3 CE/python/site-packages/ecdsa/ecdsa.pyc

rKXc@sdZddlmZmZmZddlmZddlmZddlZde	fdYZ
d	e	fd
YZde	fdYZd
Z
dZdZdZdZdZdZdZdZejedeZejeeeeZdZdZdZdZdZejedeZejeeeeZdZdZdZdZd ZejedeZejeeeeZd!Zd"Zd#Zd$Zd%ZejedeZejeeeeZd&Zd'Zd(Zd)Zd*ZejedeZ eje eeeZ!d+Z"d,Zd-Zd.Zd/Zd0Zejee"eZ#eje#eeeZ$d1Z%e&d2kre%ndS(3s
Implementation of Elliptic-Curve Digital Signatures.

Classes and methods for elliptic-curve signatures:
private keys, public keys, signatures,
NIST prime-modulus curves with modulus lengths of
192, 224, 256, 384, and 521 bits.

Example:

  # (In real-life applications, you would probably want to
  # protect against defects in SystemRandom.)
  from random import SystemRandom
  randrange = SystemRandom().randrange

  # Generate a public/private key pair using the NIST Curve P-192:

  g = generator_192
  n = g.order()
  secret = randrange( 1, n )
  pubkey = Public_key( g, g * secret )
  privkey = Private_key( pubkey, secret )

  # Signing a hash value:

  hash = randrange( 1, n )
  signature = privkey.sign( hash, randrange( 1, n ) )

  # Verifying a signature for a hash value:

  if pubkey.verifies( hash, signature ):
    print_("Demo verification succeeded.")
  else:
    print_("*** Demo verification failed.")

  # Verification fails if the hash value is modified:

  if pubkey.verifies( hash-1, signature ):
    print_("**** Demo verification failed to reject tampered hash.")
  else:
    print_("Demo verification correctly rejected tampered hash.")

Version of 2009.05.16.

Revision history:
      2005.12.31 - Initial version.
      2008.11.25 - Substantial revisions introducing new classes.
      2009.05.16 - Warn against using random.randrange in real applications.
      2009.05.17 - Use random.SystemRandom by default.

Written in 2005 by Peter Pearson and placed in the public domain.
i(tint2bytetbtprint_(t
ellipticcurve(tnumbertheoryiNt	SignaturecBseZdZdZRS(sECDSA signature.
  cCs||_||_dS(N(trts(tselfRR((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyt__init__Bs	(t__name__t
__module__t__doc__R	(((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR?st
Public_keycBs eZdZdZdZRS(sPublic key for ECDSA.
  cCs|j|_||_||_|j}|sBtdn||tjksdtdn|jdks||jks|jdks||jkrtdndS(sigenerator is the Point that generates the group,
    point is the Point that defines the public key.
    s Generator point must have order.sGenerator point order is bad.is(Generator point has x or y out of range.N(	tcurvet	generatortpointtordertRuntimeErrorRtINFINITYtxty(RRRtn((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR	Ls		HcCs|j}|j}|j}|j}|dksC||dkrGtS|dksc||dkrgtStj||}|||}|||}	|||	|j}
|
j|}||kS(scVerify that signature is a valid signature of hash.
    Return True if the signature is valid.
    i(	RRRRtFalseRtinverse_modRR(Rthasht	signaturetGRRRtctu1tu2txytv((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pytverifies]s			(R
RRR	R!(((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR
Hs	tPrivate_keycBs eZdZdZdZRS(sPrivate key for ECDSA.
  cCs||_||_dS(sQpublic_key is of class Public_key;
    secret_multiplier is a large integer.
    N(t
public_keytsecret_multiplier(RR#R$((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR	ws	c	Cs|jj}|j}||}||}|j}|dkrStdntj||||j|||}|dkrtdnt||S(sReturn a signature for the provided hash, using the provided
    random nonce.  It is absolutely vital that random_k be an unpredictable
    number in the range [1, self.public_key.point.order()-1].  If
    an attacker can guess random_k, he can compute our private key from a
    single signature.  Also, if an attacker knows a few high-order
    bits (or a few low-order bits) of random_k, he can compute our private
    key from many signatures.  The generation of nonces with adequate
    cryptographic strength is very difficult and far beyond the scope
    of this comment.

    May raise RuntimeError, in which case retrying with a new
    random value k is in order.
    is!amazingly unlucky random number rs!amazingly unlucky random number s(	R#RRRRRRR$R(	RRtrandom_kRRtktp1RR((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pytsigns

(R
RRR	R((((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR"ss	cCs|dkst|dkr(tdSg}x1|ra|d@}|jt||dL}q1W|jtdj|S(s7Convert integer x into a string of bytes, as per X9.62.itiit(tAssertionErrorRtappendRtreversetjoin(Rtresulttordinal((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyt
int_to_strings
	

cCsGd}x:|D]2}t|ts1t|}nd||}q
W|S(s8Convert a string of bytes into an integer, as per X9.62.ii(t
isinstancetinttord(RR/R((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyt
string_to_ints
cCs,ddlm}t|t|jS(smConvert an integer into a string of bytes, compute
     its SHA-1 hash, and convert the result to an integer.i(tsha1(thashlibR6R5R1tdigest(tmR6((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pytdigest_integerscCs|j}|j}|dksH||ksH|dksH||krLtS|j||sbtS|tj|||tjkstStS(s=Is (x,y) a valid public key based on the specified generator?i(RRRtcontains_pointRtPointRtTrue(RRRRR((s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q}dr}||||||tds}dt}du}dv}dw}||||||tdx}dy}dz}d{}d|}||||||td}}d~}d}d}d}||||||ttdt}|j
}tjj}|d|}t|||}t||}|d|}|j||d|}|j
||rtdnd|j
|d|rdn
tddS(NtTestFailurecBseZRS((R
R(((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyR?scs5t||||kr%tdnddS(srgenerator defines the curve; is (x,y) a point on
       this curve? "expected" is True if the right answer is Yes.s"Point validity tested as expected.s**** Point validity test gave wrong result.N(R>R(RRRtexpected(R?(sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyttest_point_validitys
cs|tttjt||}|jt|t||}||krbtd||fnd||fdS(sMsg = message, Qx and Qy represent the base point on
       elliptic curve c192, R and S are the signature, and
       "expected" is True iff the signature is expected to be valid.s2Signature tested as expected: got %s, expected %s.s/*** Signature test failed: got %s, expected %s.N(	R
t
generator_192RR<t	curve_192R!R:RR(tMsgtQxtQytRtSR@tpubktgot(R?(sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyttest_signature_validity%s!sNIST Curve P-192:l
uH=.t.#",W}7?jl
Z`uSG;R-]]0sk	+s*** p192 * d came out wrong.sp192 * d came out right.l
N/vZL_~XXw]ol
~n&DJ,6'1a47b?`l
5XD+8n#w}rO	s*** k * p192 came out wrong.sk * p192 came out right.l
WTY>n+BtC*Yql
!M_JT96wfF[
,z=s&*** u1 * p192 + u2 * Q came out wrong.s"u1 * p192 + u2 * Q came out right.lX9	BWGZ@G6|2l
v;*Y<Lu<+=<fs*** r or s came out wrong.sr and s came out right.sSignature verified OK.s"*** Signature failed verification.isForgery was correctly rejected.s%*** Forgery was erroneously accepted.s1Testing point validity, as per ECDSAVS.pdf B.2.2:l
:HJ`4wwqVXR}h
xhl
MuC	E|dD30v[6?Ll
;G-^
lqkwdx.}jsq~l
*vdF*Me5RN"[T]	l
'q%_h$z0W]uq?l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Z9br`HP_=7Tz=(`xGHC0br7l
Sgk"Z{h7E&qS?dU	l
 er&SE/,J^pt$bl
h&~AJ gKl
-	_kEl
5pq!09lxBm^bI.lENB!nk;`es`IhFa~d-"%y%7D30\5	#M_LzFXpJ'8cN}I=|nh@hQcB0~yA*@d3%4	fS]xYBU3z+!l
5Xyn"Mz$YI)Z]?l
kg":(VeFo/+p!e[l
xt:!lM1l)3|^{:y6l
h6ns(#lrI<-9pTvlEx6B,^q$I}-]I*-8pVK tjQ9yG	eCP{(CF\ N.@V\Qst4F<Ykq.=oPKhal_*!$0['B]M]'M0(B
l
%3 aoqQ{FZg(knvTjl
xm%<DifPjXNOa@Z^l
#Oh?7HB[qJf&0F
l
/BW
de&b"Ej+NY"	x=!8lE-"fnAJEIphz<WuYm,9?@Q]_@f
*w2}]m%#5O0BQy*,cP7H@K2_	^V>RLT"	}-\<lfj:S@<p
aK8i>E3l
w|FM<$?i
&i_6NzVl
"N?xVP3|xl/M-AdSl
!-iuL
Vw|k3	l
crE;X<v 
lN`fma	sTesting the example code:sDemo verification succeeded.s*** Demo verification failed.s6**** Demo verification failed to reject tampered hash.s3Demo verification correctly rejected tampered hash.(t	ExceptionRRBRRR
R"R(RRR!RR=RtrandomtSystemRandomt	randrange(RARKtp192tdtQR&RGRRttempteRItprivktsigRRtvalidRDRERFRHtgRROtsecrettpubkeytprivkeyRR((R?sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyt__main__s













R\('RtsixRRRR*RRRMtobjectRR
R"R1R5R:R>t_pt_rt_bt_Gxt_GytCurveFpRCR<RBt	curve_224t
generator_224t	curve_256t
generator_256t	curve_384t
generator_384t	curve_521t
generator_521t_atcurve_secp256k1tgenerator_secp256k1R\R
(((sQC:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\ecdsa\ecdsa.pyt<module>6st	+(						&

Anon7 - 2022
AnonSec Team