/usr/lib/python2.6/site-packages/rsa
NameSizeModeActions
asn1.py17810644editdlrm
asn1.pyc16530644editdlrm
asn1.pyo16530644editdlrm
bigfile.py51850644editdlrm
bigfile.pyc47860644editdlrm
bigfile.pyo47860644editdlrm
cli.py121850644editdlrm
cli.pyc133190644editdlrm
cli.pyo133190644editdlrm
common.py46400644editdlrm
common.pyc42350644editdlrm
common.pyo42350644editdlrm
core.py16560644editdlrm
core.pyc14850644editdlrm
core.pyo14850644editdlrm
key.py228670644editdlrm
key.pyc239860644editdlrm
key.pyo239860644editdlrm
parallel.py22990644editdlrm
parallel.pyc20980644editdlrm
parallel.pyo20980644editdlrm
pem.py35370644editdlrm
pem.pyc28430644editdlrm
pem.pyo28430644editdlrm
pkcs1.py122300644editdlrm
pkcs1.pyc111730644editdlrm
pkcs1.pyo111260644editdlrm
prime.py45600644editdlrm
prime.pyc36640644editdlrm
prime.pyo36180644editdlrm
randnum.py26430644editdlrm
randnum.pyc20740644editdlrm
randnum.pyo20740644editdlrm
transform.py68920644editdlrm
transform.pyc58560644editdlrm
transform.pyo58560644editdlrm
util.py30590644editdlrm
util.pyc25200644editdlrm
util.pyo24490644editdlrm
varblock.py54060644editdlrm
varblock.pyc48560644editdlrm
varblock.pyo48560644editdlrm
_compat.py38900644editdlrm
_compat.pyc36550644editdlrm
_compat.pyo36550644editdlrm
_version133.py117640644editdlrm
_version133.pyc136390644editdlrm
_version133.pyo136390644editdlrm
_version200.py151230644editdlrm
_version200.pyc152640644editdlrm
_version200.pyo152640644editdlrm
__init__.py14760644editdlrm
__init__.pyc11120644editdlrm
__init__.pyo11120644editdlrm
Edit: /usr/lib/python2.6/site-packages/rsa/varblock.pyo (4856B)
Ñò |~úVc@srdZddkZddklZlZedƒZdZeideƒd„Z d„Z d „Z d „Z dS( sjVARBLOCK file support .. deprecated:: 3.4 The VARBLOCK format is NOT recommended for general use, has been deprecated since Python-RSA 3.4, and will be removed in a future release. It's vulnerable to a number of attacks: 1. decrypt/encrypt_bigfile() does not implement `Authenticated encryption`_ nor uses MACs to verify messages before decrypting public key encrypted messages. 2. decrypt/encrypt_bigfile() does not use hybrid encryption (it uses plain RSA) and has no method for chaining, so block reordering is possible. See `issue #19 on Github`_ for more information. .. _Authenticated encryption: https://en.wikipedia.org/wiki/Authenticated_encryption .. _issue #19 on Github: https://github.com/sybrenstuvel/python-rsa/issues/13 The VARBLOCK file format is as follows, where || denotes byte concatenation: FILE := VERSION || BLOCK || BLOCK ... BLOCK := LENGTH || DATA LENGTH := varint-encoded length of the subsequent data. Varint comes from Google Protobuf, and encodes an integer into a variable number of bytes. Each byte uses the 7 lowest bits to encode the value. The highest bit set to 1 indicates the next byte is also part of the varint. The last byte will have this bit set to 0. This file format is called the VARBLOCK format, in line with the varint format used to denote the block sizes. iÿÿÿÿN(tbytetbtisÀThe 'rsa.varblock' module was deprecated in Python-RSA version 3.4 due to security issues in the VARBLOCK format. See https://github.com/sybrenstuvel/python-rsa/issues/13 for more information.cCs©d}d}x–toŽ|idƒ}t|ƒdjo&|djodStd|ƒ‚nt|ƒ}||d@d|>7}|d7}|d@p ||fSqWdS( sxReads a varint from the file. When the first byte to be read indicates EOF, (0, 0) is returned. When an EOF occurs when at least one byte has been read, an EOFError exception is raised. :param infile: the file-like object to read from. It should have a read() method. :returns: (varint, length), the read varint and the number of read bytes. iis,EOF while reading varint, value is %i so fariii€N(ii(tTruetreadtlentEOFErrortord(tinfiletvarintt read_bytestcharR((s0/usr/lib/python2.6/site-packages/rsa/varblock.pyt read_varintCs     cCsŠ|djo|itƒdSd}x^|djoP|d@}|dL}|djo|dO}n|it|ƒƒ|d7}q(W|S(sªWrites a varint to a file. :param outfile: the file-like object to write to. It should have a write() method. :returns: the number of written bytes. iiiii€(twritet ZERO_BYTER(toutfiletvaluet written_bytestto_write((s0/usr/lib/python2.6/site-packages/rsa/varblock.pyt write_varintcs      ccsê|idƒ}t|ƒdjotdƒ‚nt|ƒ}|tjotd|ƒ‚nx„to|t|ƒ\}}|djo|djoPn|i|ƒ}t|ƒ}||jotd||fƒ‚n|VqbWdS(sÖGenerator, yields each block in the input file. :param infile: file to read, is expected to have the VARBLOCK format as described in the module's docstring. @yields the contents of each block. iis&Unable to read VARBLOCK version numbers!VARBLOCK version %i not supporteds.Block size is %i, but could read only %i bytesN(RRRRtVARBLOCK_VERSIONt ValueErrorRR (Rt first_chartversiont block_sizeR tblockt read_size((s0/usr/lib/python2.6/site-packages/rsa/varblock.pytyield_varblocks€s"     ccsWxPtoH|i|ƒ}t|ƒ}|djoPn|V||joPqqWdS(sÅGenerator, yields each block of ``blocksize`` bytes in the input file. :param infile: file to read and separate in blocks. :returns: a generator that yields the contents of each block iN(RRR(Rt blocksizeRR ((s0/usr/lib/python2.6/site-packages/rsa/varblock.pytyield_fixedblocks¢s   ( t__doc__twarningst rsa._compatRRRRtwarntDeprecationWarningR RRR(((s0/usr/lib/python2.6/site-packages/rsa/varblock.pyt4s     "