Linux lorencats.com 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l
Apache/2.4.59 (Raspbian)
: 10.0.0.29 | : 216.73.216.130
Cant Read [ /etc/named.conf ]
7.3.31-1~deb10u7
root
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
IPython /
lib /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
785
B
-rw-r--r--
backgroundjobs.py
17.37
KB
-rw-r--r--
clipboard.py
2.21
KB
-rw-r--r--
deepreload.py
11.03
KB
-rw-r--r--
demo.py
19.99
KB
-rw-r--r--
display.py
20.15
KB
-rw-r--r--
editorhooks.py
3.94
KB
-rw-r--r--
guisupport.py
6.16
KB
-rw-r--r--
inputhook.py
23.04
KB
-rw-r--r--
inputhookglut.py
5.96
KB
-rw-r--r--
inputhookgtk.py
1017
B
-rw-r--r--
inputhookgtk3.py
1012
B
-rw-r--r--
inputhookpyglet.py
3.58
KB
-rw-r--r--
inputhookqt4.py
6.64
KB
-rw-r--r--
inputhookwx.py
5.92
KB
-rw-r--r--
kernel.py
297
B
-rw-r--r--
latextools.py
6.24
KB
-rw-r--r--
lexers.py
18.25
KB
-rw-r--r--
pretty.py
27.82
KB
-rw-r--r--
security.py
3.25
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : security.py
""" Password generation for the IPython notebook. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Stdlib import getpass import hashlib import random # Our own from IPython.core.error import UsageError from IPython.utils.py3compat import cast_bytes, str_to_bytes #----------------------------------------------------------------------------- # Globals #----------------------------------------------------------------------------- # Length of the salt in nr of hex chars, which implies salt_len * 4 # bits of randomness. salt_len = 12 #----------------------------------------------------------------------------- # Functions #----------------------------------------------------------------------------- def passwd(passphrase=None, algorithm='sha1'): """Generate hashed password and salt for use in notebook configuration. In the notebook configuration, set `c.NotebookApp.password` to the generated string. Parameters ---------- passphrase : str Password to hash. If unspecified, the user is asked to input and verify a password. algorithm : str Hashing algorithm to use (e.g, 'sha1' or any argument supported by :func:`hashlib.new`). Returns ------- hashed_passphrase : str Hashed password, in the format 'hash_algorithm:salt:passphrase_hash'. Examples -------- >>> passwd('mypassword') 'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12' """ if passphrase is None: for i in range(3): p0 = getpass.getpass('Enter password: ') p1 = getpass.getpass('Verify password: ') if p0 == p1: passphrase = p0 break else: print('Passwords do not match.') else: raise UsageError('No matching passwords found. Giving up.') h = hashlib.new(algorithm) salt = ('%0' + str(salt_len) + 'x') % random.getrandbits(4 * salt_len) h.update(cast_bytes(passphrase, 'utf-8') + str_to_bytes(salt, 'ascii')) return ':'.join((algorithm, salt, h.hexdigest())) def passwd_check(hashed_passphrase, passphrase): """Verify that a given passphrase matches its hashed version. Parameters ---------- hashed_passphrase : str Hashed password, in the format returned by `passwd`. passphrase : str Passphrase to validate. Returns ------- valid : bool True if the passphrase matches the hash. Examples -------- >>> from IPython.lib.security import passwd_check >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a', ... 'mypassword') True >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a', ... 'anotherpassword') False """ try: algorithm, salt, pw_digest = hashed_passphrase.split(':', 2) except (ValueError, TypeError): return False try: h = hashlib.new(algorithm) except ValueError: return False if len(pw_digest) == 0: return False h.update(cast_bytes(passphrase, 'utf-8') + cast_bytes(salt, 'ascii')) return h.hexdigest() == pw_digest
Close