/opt/alt/python35/lib64/python3.5
NameSizeModeActions
asyncio/-0755rm
collections/-0755rm
concurrent/-0755rm
config-3.5m/-0755rm
ctypes/-0755rm
curses/-0755rm
dbm/-0755rm
distutils/-0755rm
email/-0755rm
encodings/-0755rm
ensurepip/-0755rm
html/-0755rm
http/-0755rm
idlelib/-0755rm
importlib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
plat-linux/-0755rm
pydoc_data/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
test/-0755rm
unittest/-0755rm
urllib/-0755rm
venv/-0755rm
wsgiref/-0755rm
xml/-0755rm
xmlrpc/-0755rm
__pycache__/-0755rm
abc.py86280644editdlrm
aifc.py319670644editdlrm
antigravity.py4760644editdlrm
argparse.py901380644editdlrm
ast.py120010644editdlrm
asynchat.py119710644editdlrm
asyncore.py201040644editdlrm
base64.py205220755editdlrm
bdb.py233540644editdlrm
binhex.py139540644editdlrm
bisect.py25950644editdlrm
bz2.py124240644editdlrm
calendar.py229980644editdlrm
cgi.py360460755editdlrm
cgitb.py120230644editdlrm
chunk.py54250644editdlrm
cmd.py148600644editdlrm
code.py101180644editdlrm
codecs.py362310644editdlrm
codeop.py59940644editdlrm
colorsys.py40640644editdlrm
compileall.py117110644editdlrm
configparser.py534520644editdlrm
contextlib.py124510644editdlrm
copy.py89460644editdlrm
copyreg.py68330644editdlrm
cProfile.py53240755editdlrm
crypt.py18790644editdlrm
csv.py161280644editdlrm
datetime.py758990644editdlrm
decimal.py3200644editdlrm
difflib.py842040644editdlrm
dis.py173500644editdlrm
doctest.py1040360644editdlrm
dummy_threading.py28150644editdlrm
enum.py222260644editdlrm
filecmp.py98300644editdlrm
fileinput.py142590644editdlrm
fnmatch.py31630644editdlrm
formatter.py151430644editdlrm
fractions.py246120644editdlrm
ftplib.py349510644editdlrm
functools.py289440644editdlrm
genericpath.py43640644editdlrm
getopt.py74890644editdlrm
getpass.py59940644editdlrm
gettext.py215300644editdlrm
glob.py50720644editdlrm
gzip.py202600644editdlrm
hashlib.py79790644editdlrm
heapq.py229290644editdlrm
hmac.py50630644editdlrm
imaplib.py521830644editdlrm
imghdr.py37580644editdlrm
imp.py106760644editdlrm
inspect.py1141990644editdlrm
io.py33960644editdlrm
ipaddress.py757330644editdlrm
keyword.py22220755editdlrm
linecache.py53120644editdlrm
locale.py747130644editdlrm
lzma.py129250644editdlrm
macpath.py59070644editdlrm
macurl2path.py27320644editdlrm
mailbox.py784180644editdlrm
mailcap.py81040644editdlrm
mimetypes.py208470644editdlrm
modulefinder.py230850644editdlrm
netrc.py57480644editdlrm
nntplib.py430780644editdlrm
ntpath.py227930644editdlrm
nturl2path.py24440644editdlrm
numbers.py102430644editdlrm
opcode.py58850644editdlrm
operator.py108630644editdlrm
optparse.py603440644editdlrm
os.py370330644editdlrm
pathlib.py470010644editdlrm
pdb.py611490755editdlrm
pickle.py561760644editdlrm
pickletools.py917610644editdlrm
pipes.py89160644editdlrm
pkgutil.py213550644editdlrm
platform.py461470755editdlrm
plistlib.py318100644editdlrm
poplib.py147170644editdlrm
posixpath.py149110644editdlrm
pprint.py208600644editdlrm
profile.py220320755editdlrm
pstats.py265640644editdlrm
pty.py47630644editdlrm
pyclbr.py135640644editdlrm
pydoc.py1036520755editdlrm
py_compile.py71810644editdlrm
queue.py87800644editdlrm
quopri.py72650755editdlrm
random.py264630644editdlrm
re.py155010644editdlrm
reprlib.py53360644editdlrm
rlcompleter.py63070644editdlrm
runpy.py119590644editdlrm
sched.py62160644editdlrm
selectors.py194380644editdlrm
shelve.py85280644editdlrm
shlex.py114480644editdlrm
shutil.py400480644editdlrm
signal.py21230644editdlrm
site.py215090644editdlrm
smtpd.py353730755editdlrm
smtplib.py436350755editdlrm
sndhdr.py64180644editdlrm
socket.py271350644editdlrm
socketserver.py246660644editdlrm
sre_compile.py184100644editdlrm
sre_constants.py68210644editdlrm
sre_parse.py351170644editdlrm
ssl.py423520644editdlrm
stat.py50380644editdlrm
statistics.py195330644editdlrm
string.py118540644editdlrm
stringprep.py129170644editdlrm
struct.py2570644editdlrm
subprocess.py589120644editdlrm
sunau.py180950644editdlrm
symbol.py21060755editdlrm
symtable.py71910644editdlrm
sysconfig.py244620644editdlrm
tabnanny.py114140755editdlrm
tarfile.py930700755editdlrm
telnetlib.py230160644editdlrm
tempfile.py266360644editdlrm
textwrap.py195580644editdlrm
this.py10030644editdlrm
threading.py490270644editdlrm
timeit.py124030755editdlrm
token.py30750644editdlrm
tokenize.py277900644editdlrm
trace.py315530755editdlrm
traceback.py221750644editdlrm
tracemalloc.py156410644editdlrm
tty.py8790644editdlrm
types.py87990644editdlrm
typing.py801350644editdlrm
uu.py67660755editdlrm
uuid.py232610644editdlrm
warnings.py158500644editdlrm
wave.py176820644editdlrm
weakref.py204660644editdlrm
webbrowser.py218280755editdlrm
xdrlib.py59130644editdlrm
zipapp.py71570644editdlrm
zipfile.py736720644editdlrm
_bootlocale.py13010644editdlrm
_collections_abc.py247940644editdlrm
_compat_pickle.py85560644editdlrm
_compression.py53400644editdlrm
_dummy_thread.py51180644editdlrm
_markupbase.py145980644editdlrm
_osx_support.py191150644editdlrm
_pydecimal.py2286280644editdlrm
_pyio.py879680644editdlrm
_sitebuiltins.py31150644editdlrm
_strptime.py221850644editdlrm
_sysconfigdata.py242730644editdlrm
_threading_local.py74100644editdlrm
_weakrefset.py57050644editdlrm
__future__.py48410644editdlrm
__phello__.foo.py640644editdlrm
Edit: /opt/alt/python35/lib64/python3.5/hashlib.py (7979B)
#. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, data=b'') - returns a new hash object implementing the given hash function; initializing the hash using the given binary data. Named constructor functions are also available, these are faster than using new(name): md5(), sha1(), sha224(), sha256(), sha384(), and sha512() More algorithms may be available on your platform but the above are guaranteed to exist. See the algorithms_guaranteed and algorithms_available attributes to find out what algorithm names can be passed to new(). NOTE: If you want the adler32 or crc32 hash functions they are available in the zlib module. Choose your hash function wisely. Some have known collision weaknesses. sha384 and sha512 will be slow on 32 bit platforms. Hash objects have these methods: - update(arg): Update the hash object with the bytes in arg. Repeated calls are equivalent to a single call with the concatenation of all the arguments. - digest(): Return the digest of the bytes passed to the update() method so far. - hexdigest(): Like digest() except the digest is returned as a unicode object of double length, containing only hexadecimal digits. - copy(): Return a copy (clone) of the hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. For example, to obtain the digest of the string 'Nobody inspects the spammish repetition': >>> import hashlib >>> m = hashlib.md5() >>> m.update(b"Nobody inspects") >>> m.update(b" the spammish repetition") >>> m.digest() b'\\xbbd\\x9c\\x83\\xdd\\x1e\\xa5\\xc9\\xd9\\xde\\xc9\\xa1\\x8d\\xf0\\xff\\xe9' More condensed: >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2' """ # This tuple and __get_builtin_constructor() must be modified if a new # always available algorithm is added. __always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512') algorithms_guaranteed = set(__always_supported) algorithms_available = set(__always_supported) __all__ = __always_supported + ('new', 'algorithms_guaranteed', 'algorithms_available', 'pbkdf2_hmac') __builtin_constructor_cache = {} def __get_builtin_constructor(name): cache = __builtin_constructor_cache constructor = cache.get(name) if constructor is not None: return constructor try: if name in ('SHA1', 'sha1'): import _sha1 cache['SHA1'] = cache['sha1'] = _sha1.sha1 elif name in ('MD5', 'md5'): import _md5 cache['MD5'] = cache['md5'] = _md5.md5 elif name in ('SHA256', 'sha256', 'SHA224', 'sha224'): import _sha256 cache['SHA224'] = cache['sha224'] = _sha256.sha224 cache['SHA256'] = cache['sha256'] = _sha256.sha256 elif name in ('SHA512', 'sha512', 'SHA384', 'sha384'): import _sha512 cache['SHA384'] = cache['sha384'] = _sha512.sha384 cache['SHA512'] = cache['sha512'] = _sha512.sha512 except ImportError: pass # no extension module, this hash is unsupported. constructor = cache.get(name) if constructor is not None: return constructor raise ValueError('unsupported hash type ' + name) def __get_openssl_constructor(name): try: f = getattr(_hashlib, 'openssl_' + name) # Allow the C module to raise ValueError. The function will be # defined but the hash not actually available thanks to OpenSSL. f() # Use the C function directly (very fast) return f except (AttributeError, ValueError): return __get_builtin_constructor(name) def __py_new(name, data=b''): """new(name, data=b'') - Return a new hashing object using the named algorithm; optionally initialized with data (which must be bytes). """ return __get_builtin_constructor(name)(data) def __hash_new(name, data=b''): """new(name, data=b'') - Return a new hashing object using the named algorithm; optionally initialized with data (which must be bytes). """ try: return _hashlib.new(name, data) except ValueError: # If the _hashlib module (OpenSSL) doesn't support the named # hash, try using our builtin implementations. # This allows for SHA224/256 and SHA384/512 support even though # the OpenSSL library prior to 0.9.8 doesn't provide them. return __get_builtin_constructor(name)(data) try: import _hashlib new = __hash_new __get_hash = __get_openssl_constructor algorithms_available = algorithms_available.union( _hashlib.openssl_md_meth_names) except ImportError: new = __py_new __get_hash = __get_builtin_constructor try: # OpenSSL's PKCS5_PBKDF2_HMAC requires OpenSSL 1.0+ with HMAC and SHA from _hashlib import pbkdf2_hmac except ImportError: _trans_5C = bytes((x ^ 0x5C) for x in range(256)) _trans_36 = bytes((x ^ 0x36) for x in range(256)) def pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None): """Password based key derivation function 2 (PKCS #5 v2.0) This Python implementations based on the hmac module about as fast as OpenSSL's PKCS5_PBKDF2_HMAC for short passwords and much faster for long passwords. """ if not isinstance(hash_name, str): raise TypeError(hash_name) if not isinstance(password, (bytes, bytearray)): password = bytes(memoryview(password)) if not isinstance(salt, (bytes, bytearray)): salt = bytes(memoryview(salt)) # Fast inline HMAC implementation inner = new(hash_name) outer = new(hash_name) blocksize = getattr(inner, 'block_size', 64) if len(password) > blocksize: password = new(hash_name, password).digest() password = password + b'\x00' * (blocksize - len(password)) inner.update(password.translate(_trans_36)) outer.update(password.translate(_trans_5C)) def prf(msg, inner=inner, outer=outer): # PBKDF2_HMAC uses the password as key. We can re-use the same # digest objects and just update copies to skip initialization. icpy = inner.copy() ocpy = outer.copy() icpy.update(msg) ocpy.update(icpy.digest()) return ocpy.digest() if iterations < 1: raise ValueError(iterations) if dklen is None: dklen = outer.digest_size if dklen < 1: raise ValueError(dklen) dkey = b'' loop = 1 from_bytes = int.from_bytes while len(dkey) < dklen: prev = prf(salt + loop.to_bytes(4, 'big')) # endianess doesn't matter here as long to / from use the same rkey = int.from_bytes(prev, 'big') for i in range(iterations - 1): prev = prf(prev) # rkey = rkey ^ prev rkey ^= from_bytes(prev, 'big') loop += 1 dkey += rkey.to_bytes(inner.digest_size, 'big') return dkey[:dklen] for __func_name in __always_supported: # try them all, some may not work due to the OpenSSL # version not supporting that algorithm. try: globals()[__func_name] = __get_hash(__func_name) except ValueError: import logging logging.exception('code for hash %s was not found.', __func_name) # Cleanup locals() del __always_supported, __func_name, __get_hash del __py_new, __hash_new, __get_openssl_constructor