Linux server1.hosting4iran.com 4.18.0-553.123.2.el8_10.x86_64 #1 SMP Thu May 7 15:28:41 EDT 2026 x86_64
LiteSpeed
Server IP : 185.208.174.156 & Your IP : 216.73.216.74
Domains : 326 Domain
User : satitravel
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
python3-docs /
html /
library /
Delete
Unzip
Name
Size
Permission
Date
Action
2to3.html
60.26
KB
-rw-r--r--
2023-12-18 11:36
__future__.html
15.42
KB
-rw-r--r--
2023-12-18 11:36
__main__.html
8.81
KB
-rw-r--r--
2023-12-18 11:36
_dummy_thread.html
8.98
KB
-rw-r--r--
2023-12-18 11:36
_thread.html
22.06
KB
-rw-r--r--
2023-12-18 11:36
abc.html
40.42
KB
-rw-r--r--
2023-12-18 11:36
aifc.html
27.46
KB
-rw-r--r--
2023-12-18 11:36
allos.html
31.48
KB
-rw-r--r--
2023-12-18 11:36
archiving.html
11.71
KB
-rw-r--r--
2023-12-18 11:36
argparse.html
268.54
KB
-rw-r--r--
2023-12-18 11:36
array.html
32.76
KB
-rw-r--r--
2023-12-18 11:36
ast.html
38.67
KB
-rw-r--r--
2023-12-18 11:36
asynchat.html
31.78
KB
-rw-r--r--
2023-12-18 11:36
asyncio-dev.html
50.65
KB
-rw-r--r--
2023-12-18 11:36
asyncio-eventloop.html
108.61
KB
-rw-r--r--
2023-12-18 11:36
asyncio-eventloops.html
32.25
KB
-rw-r--r--
2023-12-18 11:36
asyncio-protocol.html
85.38
KB
-rw-r--r--
2023-12-18 11:36
asyncio-queue.html
23.4
KB
-rw-r--r--
2023-12-18 11:36
asyncio-stream.html
59.58
KB
-rw-r--r--
2023-12-18 11:36
asyncio-subprocess.html
56.66
KB
-rw-r--r--
2023-12-18 11:36
asyncio-sync.html
34.84
KB
-rw-r--r--
2023-12-18 11:36
asyncio-task.html
82
KB
-rw-r--r--
2023-12-18 11:36
asyncio.html
27.37
KB
-rw-r--r--
2023-12-18 11:36
asyncore.html
41.71
KB
-rw-r--r--
2023-12-18 11:36
atexit.html
18
KB
-rw-r--r--
2023-12-18 11:36
audioop.html
34.61
KB
-rw-r--r--
2023-12-18 11:36
base64.html
35.6
KB
-rw-r--r--
2023-12-18 11:36
bdb.html
42.41
KB
-rw-r--r--
2023-12-18 11:36
binary.html
12.42
KB
-rw-r--r--
2023-12-18 11:36
binascii.html
24.17
KB
-rw-r--r--
2023-12-18 11:36
binhex.html
11.4
KB
-rw-r--r--
2023-12-18 11:36
bisect.html
25
KB
-rw-r--r--
2023-12-18 11:36
builtins.html
11.33
KB
-rw-r--r--
2023-12-18 11:36
bz2.html
32.58
KB
-rw-r--r--
2023-12-18 11:36
calendar.html
38.61
KB
-rw-r--r--
2023-12-18 11:36
cgi.html
54.57
KB
-rw-r--r--
2023-12-18 11:36
cgitb.html
12.47
KB
-rw-r--r--
2023-12-18 11:36
chunk.html
16.48
KB
-rw-r--r--
2023-12-18 11:36
cmath.html
33.37
KB
-rw-r--r--
2023-12-18 11:36
cmd.html
42.78
KB
-rw-r--r--
2023-12-18 11:36
code.html
27.23
KB
-rw-r--r--
2023-12-18 11:36
codecs.html
130.93
KB
-rw-r--r--
2023-12-18 11:36
codeop.html
13.97
KB
-rw-r--r--
2023-12-18 11:36
collections.abc.html
59.48
KB
-rw-r--r--
2023-12-18 11:36
collections.html
151.31
KB
-rw-r--r--
2023-12-18 11:36
colorsys.html
12.33
KB
-rw-r--r--
2023-12-18 11:36
compileall.html
27.6
KB
-rw-r--r--
2023-12-18 11:36
concurrency.html
20.71
KB
-rw-r--r--
2023-12-18 11:36
concurrent.futures.html
59.24
KB
-rw-r--r--
2023-12-18 11:36
concurrent.html
7.77
KB
-rw-r--r--
2023-12-18 11:36
configparser.html
137.75
KB
-rw-r--r--
2023-12-18 11:36
constants.html
17.09
KB
-rw-r--r--
2023-12-18 11:36
contextlib.html
86.72
KB
-rw-r--r--
2023-12-18 11:36
copy.html
13.52
KB
-rw-r--r--
2023-12-18 11:36
copyreg.html
14.38
KB
-rw-r--r--
2023-12-18 11:36
crypt.html
19.85
KB
-rw-r--r--
2023-12-18 11:36
crypto.html
10.66
KB
-rw-r--r--
2023-12-18 11:36
csv.html
67.42
KB
-rw-r--r--
2023-12-18 11:36
ctypes.html
258.33
KB
-rw-r--r--
2023-12-18 11:36
curses.ascii.html
24.61
KB
-rw-r--r--
2023-12-18 11:36
curses.html
171.44
KB
-rw-r--r--
2023-12-18 11:36
curses.panel.html
16.31
KB
-rw-r--r--
2023-12-18 11:36
custominterp.html
8.53
KB
-rw-r--r--
2023-12-18 11:36
datatypes.html
23.39
KB
-rw-r--r--
2023-12-18 11:36
datetime.html
299.25
KB
-rw-r--r--
2023-12-18 11:36
dbm.html
42.11
KB
-rw-r--r--
2023-12-18 11:36
debug.html
13.66
KB
-rw-r--r--
2023-12-18 11:36
decimal.html
228.01
KB
-rw-r--r--
2023-12-18 11:36
development.html
24.53
KB
-rw-r--r--
2023-12-18 11:36
difflib.html
93.9
KB
-rw-r--r--
2023-12-18 11:36
dis.html
103.7
KB
-rw-r--r--
2023-12-18 11:36
distribution.html
10.26
KB
-rw-r--r--
2023-12-18 11:36
distutils.html
10.63
KB
-rw-r--r--
2023-12-18 11:36
doctest.html
175.54
KB
-rw-r--r--
2023-12-18 11:36
dummy_threading.html
9.1
KB
-rw-r--r--
2023-12-18 11:36
email.charset.html
25.81
KB
-rw-r--r--
2023-12-18 11:36
email.compat32-message.html
84.13
KB
-rw-r--r--
2023-12-18 11:36
email.contentmanager.html
29.32
KB
-rw-r--r--
2023-12-18 11:36
email.encoders.html
13.92
KB
-rw-r--r--
2023-12-18 11:36
email.errors.html
19.24
KB
-rw-r--r--
2023-12-18 11:36
email.examples.html
56.52
KB
-rw-r--r--
2023-12-18 11:36
email.generator.html
40.82
KB
-rw-r--r--
2023-12-18 11:36
email.header.html
30.49
KB
-rw-r--r--
2023-12-18 11:36
email.headerregistry.html
56.32
KB
-rw-r--r--
2023-12-18 11:36
email.html
27.09
KB
-rw-r--r--
2023-12-18 11:36
email.iterators.html
13.21
KB
-rw-r--r--
2023-12-18 11:36
email.message.html
85.17
KB
-rw-r--r--
2023-12-18 11:36
email.mime.html
35.24
KB
-rw-r--r--
2023-12-18 11:36
email.parser.html
46.32
KB
-rw-r--r--
2023-12-18 11:36
email.policy.html
73.48
KB
-rw-r--r--
2023-12-18 11:36
email.util.html
33.06
KB
-rw-r--r--
2023-12-18 11:36
ensurepip.html
18.26
KB
-rw-r--r--
2023-12-18 11:36
enum.html
130.81
KB
-rw-r--r--
2023-12-18 11:36
errno.html
40.36
KB
-rw-r--r--
2023-12-18 11:36
exceptions.html
83.16
KB
-rw-r--r--
2023-12-18 11:36
faulthandler.html
22.85
KB
-rw-r--r--
2023-12-18 11:36
fcntl.html
26.68
KB
-rw-r--r--
2023-12-18 11:36
filecmp.html
24.45
KB
-rw-r--r--
2023-12-18 11:36
fileformats.html
10.87
KB
-rw-r--r--
2023-12-18 11:36
fileinput.html
29.33
KB
-rw-r--r--
2023-12-18 11:36
filesys.html
13.1
KB
-rw-r--r--
2023-12-18 11:36
fnmatch.html
16.59
KB
-rw-r--r--
2023-12-18 11:36
formatter.html
36.78
KB
-rw-r--r--
2023-12-18 11:36
fpectl.html
17.13
KB
-rw-r--r--
2023-12-18 11:36
fractions.html
29.22
KB
-rw-r--r--
2023-12-18 11:36
frameworks.html
13.16
KB
-rw-r--r--
2023-12-18 11:36
ftplib.html
53.15
KB
-rw-r--r--
2023-12-18 11:36
functional.html
8.79
KB
-rw-r--r--
2023-12-18 11:36
functions.html
196.76
KB
-rw-r--r--
2023-12-18 11:36
functools.html
63.43
KB
-rw-r--r--
2023-12-18 11:36
gc.html
28.83
KB
-rw-r--r--
2023-12-18 11:36
getopt.html
24.76
KB
-rw-r--r--
2023-12-18 11:36
getpass.html
11.78
KB
-rw-r--r--
2023-12-18 11:36
gettext.html
74.84
KB
-rw-r--r--
2023-12-18 11:36
glob.html
18
KB
-rw-r--r--
2023-12-18 11:36
grp.html
12.09
KB
-rw-r--r--
2023-12-18 11:36
gzip.html
31.9
KB
-rw-r--r--
2023-12-18 11:36
hashlib.html
77.69
KB
-rw-r--r--
2023-12-18 11:36
heapq.html
34.7
KB
-rw-r--r--
2023-12-18 11:36
hmac.html
17.41
KB
-rw-r--r--
2023-12-18 11:36
html.entities.html
11.09
KB
-rw-r--r--
2023-12-18 11:36
html.html
10.85
KB
-rw-r--r--
2023-12-18 11:36
html.parser.html
40.86
KB
-rw-r--r--
2023-12-18 11:36
http.client.html
63.72
KB
-rw-r--r--
2023-12-18 11:36
http.cookiejar.html
93.94
KB
-rw-r--r--
2023-12-18 11:36
http.cookies.html
38.41
KB
-rw-r--r--
2023-12-18 11:36
http.html
36.72
KB
-rw-r--r--
2023-12-18 11:36
http.server.html
56.83
KB
-rw-r--r--
2023-12-18 11:36
i18n.html
10.22
KB
-rw-r--r--
2023-12-18 11:36
idle.html
47.28
KB
-rw-r--r--
2023-12-18 11:36
imaplib.html
65.76
KB
-rw-r--r--
2023-12-18 11:36
imghdr.html
13.14
KB
-rw-r--r--
2023-12-18 11:36
imp.html
47.02
KB
-rw-r--r--
2023-12-18 11:36
importlib.html
169.05
KB
-rw-r--r--
2023-12-18 11:36
index.html
66.18
KB
-rw-r--r--
2023-12-18 11:36
inspect.html
127.3
KB
-rw-r--r--
2023-12-18 11:36
internet.html
30.36
KB
-rw-r--r--
2023-12-18 11:36
intro.html
9.67
KB
-rw-r--r--
2023-12-18 11:36
io.html
119.81
KB
-rw-r--r--
2023-12-18 11:36
ipaddress.html
103.39
KB
-rw-r--r--
2023-12-18 11:36
ipc.html
32.95
KB
-rw-r--r--
2023-12-18 11:36
itertools.html
129.71
KB
-rw-r--r--
2023-12-18 11:36
json.html
79.18
KB
-rw-r--r--
2023-12-18 11:36
keyword.html
8.71
KB
-rw-r--r--
2023-12-18 11:36
language.html
13.33
KB
-rw-r--r--
2023-12-18 11:36
linecache.html
13.18
KB
-rw-r--r--
2023-12-18 11:36
locale.html
60.1
KB
-rw-r--r--
2023-12-18 11:36
logging.config.html
83.49
KB
-rw-r--r--
2023-12-18 11:36
logging.handlers.html
109.76
KB
-rw-r--r--
2023-12-18 11:36
logging.html
131.69
KB
-rw-r--r--
2023-12-18 11:36
lzma.html
55.16
KB
-rw-r--r--
2023-12-18 11:36
macpath.html
9.04
KB
-rw-r--r--
2023-12-18 11:36
mailbox.html
153.63
KB
-rw-r--r--
2023-12-18 11:36
mailcap.html
14.33
KB
-rw-r--r--
2023-12-18 11:36
markup.html
18.9
KB
-rw-r--r--
2023-12-18 11:36
marshal.html
17.89
KB
-rw-r--r--
2023-12-18 11:36
math.html
52.4
KB
-rw-r--r--
2023-12-18 11:36
mimetypes.html
30.67
KB
-rw-r--r--
2023-12-18 11:36
misc.html
7.93
KB
-rw-r--r--
2023-12-18 11:36
mm.html
9.79
KB
-rw-r--r--
2023-12-18 11:36
mmap.html
33.49
KB
-rw-r--r--
2023-12-18 11:36
modulefinder.html
18.12
KB
-rw-r--r--
2023-12-18 11:36
modules.html
10.66
KB
-rw-r--r--
2023-12-18 11:36
msilib.html
55.86
KB
-rw-r--r--
2023-12-18 11:36
msvcrt.html
21.47
KB
-rw-r--r--
2023-12-18 11:36
multiprocessing.html
356.92
KB
-rw-r--r--
2023-12-18 11:36
netdata.html
17.06
KB
-rw-r--r--
2023-12-18 11:36
netrc.html
14.23
KB
-rw-r--r--
2023-12-18 11:36
nis.html
11.39
KB
-rw-r--r--
2023-12-18 11:36
nntplib.html
67.97
KB
-rw-r--r--
2023-12-18 11:36
numbers.html
40.46
KB
-rw-r--r--
2023-12-18 11:36
numeric.html
15.17
KB
-rw-r--r--
2023-12-18 11:36
operator.html
79.55
KB
-rw-r--r--
2023-12-18 11:36
optparse.html
244.08
KB
-rw-r--r--
2023-12-18 11:36
os.html
388.71
KB
-rw-r--r--
2023-12-18 11:36
os.path.html
52.56
KB
-rw-r--r--
2023-12-18 11:36
ossaudiodev.html
46.82
KB
-rw-r--r--
2023-12-18 11:36
othergui.html
10.02
KB
-rw-r--r--
2023-12-18 11:36
parser.html
41.41
KB
-rw-r--r--
2023-12-18 11:36
pathlib.html
113.99
KB
-rw-r--r--
2023-12-18 11:36
pdb.html
51.43
KB
-rw-r--r--
2023-12-18 11:36
persistence.html
14.92
KB
-rw-r--r--
2023-12-18 11:36
pickle.html
112.36
KB
-rw-r--r--
2023-12-18 11:36
pickletools.html
16.69
KB
-rw-r--r--
2023-12-18 11:36
pipes.html
15.62
KB
-rw-r--r--
2023-12-18 11:36
pkgutil.html
31.13
KB
-rw-r--r--
2023-12-18 11:36
platform.html
32.94
KB
-rw-r--r--
2023-12-18 11:36
plistlib.html
28.6
KB
-rw-r--r--
2023-12-18 11:36
poplib.html
30.21
KB
-rw-r--r--
2023-12-18 11:36
posix.html
17.2
KB
-rw-r--r--
2023-12-18 11:36
pprint.html
40.99
KB
-rw-r--r--
2023-12-18 11:36
profile.html
70.16
KB
-rw-r--r--
2023-12-18 11:36
pty.html
17.18
KB
-rw-r--r--
2023-12-18 11:36
pwd.html
12.79
KB
-rw-r--r--
2023-12-18 11:36
py_compile.html
15.14
KB
-rw-r--r--
2023-12-18 11:36
pyclbr.html
16.13
KB
-rw-r--r--
2023-12-18 11:36
pydoc.html
15.62
KB
-rw-r--r--
2023-12-18 11:36
pyexpat.html
86.85
KB
-rw-r--r--
2023-12-18 11:36
python.html
16.73
KB
-rw-r--r--
2023-12-18 11:36
queue.html
27.54
KB
-rw-r--r--
2023-12-18 11:36
quopri.html
13.53
KB
-rw-r--r--
2023-12-18 11:36
random.html
59.22
KB
-rw-r--r--
2023-12-18 11:36
re.html
186.7
KB
-rw-r--r--
2023-12-18 11:36
readline.html
41.15
KB
-rw-r--r--
2023-12-18 11:36
reprlib.html
24.38
KB
-rw-r--r--
2023-12-18 11:36
resource.html
35.7
KB
-rw-r--r--
2023-12-18 11:36
rlcompleter.html
14.05
KB
-rw-r--r--
2023-12-18 11:36
runpy.html
25.98
KB
-rw-r--r--
2023-12-18 11:36
sched.html
19.56
KB
-rw-r--r--
2023-12-18 11:36
secrets.html
24.15
KB
-rw-r--r--
2023-12-18 11:36
select.html
61.35
KB
-rw-r--r--
2023-12-18 11:36
selectors.html
35
KB
-rw-r--r--
2023-12-18 11:36
shelve.html
28.1
KB
-rw-r--r--
2023-12-18 11:36
shlex.html
47.83
KB
-rw-r--r--
2023-12-18 11:36
shutil.html
72.47
KB
-rw-r--r--
2023-12-18 11:36
signal.html
53.77
KB
-rw-r--r--
2023-12-18 11:36
site.html
31.49
KB
-rw-r--r--
2023-12-18 11:36
smtpd.html
35.05
KB
-rw-r--r--
2023-12-18 11:36
smtplib.html
66.83
KB
-rw-r--r--
2023-12-18 11:36
sndhdr.html
12.15
KB
-rw-r--r--
2023-12-18 11:36
socket.html
191.48
KB
-rw-r--r--
2023-12-18 11:36
socketserver.html
80
KB
-rw-r--r--
2023-12-18 11:36
spwd.html
12.04
KB
-rw-r--r--
2023-12-18 11:36
sqlite3.html
158.08
KB
-rw-r--r--
2023-12-18 11:36
ssl.html
260.08
KB
-rw-r--r--
2023-12-18 11:36
stat.html
43.67
KB
-rw-r--r--
2023-12-18 11:36
statistics.html
48.88
KB
-rw-r--r--
2023-12-18 11:36
stdtypes.html
454.74
KB
-rw-r--r--
2023-12-18 11:36
string.html
93.03
KB
-rw-r--r--
2023-12-18 11:36
stringprep.html
18.22
KB
-rw-r--r--
2023-12-18 11:36
struct.html
49.9
KB
-rw-r--r--
2023-12-18 11:36
subprocess.html
138.6
KB
-rw-r--r--
2023-12-18 11:36
sunau.html
31.01
KB
-rw-r--r--
2023-12-18 11:36
superseded.html
13.46
KB
-rw-r--r--
2023-12-18 11:36
symbol.html
8.64
KB
-rw-r--r--
2023-12-18 11:36
symtable.html
25.5
KB
-rw-r--r--
2023-12-18 11:36
sys.html
138.35
KB
-rw-r--r--
2023-12-18 11:36
sysconfig.html
29.55
KB
-rw-r--r--
2023-12-18 11:36
syslog.html
20.53
KB
-rw-r--r--
2023-12-18 11:36
tabnanny.html
11.98
KB
-rw-r--r--
2023-12-18 11:36
tarfile.html
94.49
KB
-rw-r--r--
2023-12-18 11:36
telnetlib.html
29.7
KB
-rw-r--r--
2023-12-18 11:36
tempfile.html
40.42
KB
-rw-r--r--
2023-12-18 11:36
termios.html
17.75
KB
-rw-r--r--
2023-12-18 11:36
test.html
76.71
KB
-rw-r--r--
2023-12-18 11:36
text.html
13.46
KB
-rw-r--r--
2023-12-18 11:36
textwrap.html
37.11
KB
-rw-r--r--
2023-12-18 11:36
threading.html
101.04
KB
-rw-r--r--
2023-12-18 11:36
time.html
77.76
KB
-rw-r--r--
2023-12-18 11:36
timeit.html
44.19
KB
-rw-r--r--
2023-12-18 11:36
tk.html
22.75
KB
-rw-r--r--
2023-12-18 11:36
tkinter.html
80.99
KB
-rw-r--r--
2023-12-18 11:36
tkinter.scrolledtext.html
9.72
KB
-rw-r--r--
2023-12-18 11:36
tkinter.tix.html
50.64
KB
-rw-r--r--
2023-12-18 11:36
tkinter.ttk.html
108.08
KB
-rw-r--r--
2023-12-18 11:36
token.html
22.13
KB
-rw-r--r--
2023-12-18 11:36
tokenize.html
31.4
KB
-rw-r--r--
2023-12-18 11:36
trace.html
28.46
KB
-rw-r--r--
2023-12-18 11:36
traceback.html
56.24
KB
-rw-r--r--
2023-12-18 11:36
tracemalloc.html
98.77
KB
-rw-r--r--
2023-12-18 11:36
tty.html
10.29
KB
-rw-r--r--
2023-12-18 11:36
turtle.html
244.5
KB
-rw-r--r--
2023-12-18 11:36
types.html
36.19
KB
-rw-r--r--
2023-12-18 11:36
typing.html
135.91
KB
-rw-r--r--
2023-12-18 11:36
undoc.html
8.97
KB
-rw-r--r--
2023-12-18 11:36
unicodedata.html
20.61
KB
-rw-r--r--
2023-12-18 11:36
unittest.html
244.81
KB
-rw-r--r--
2023-12-18 11:36
unittest.mock-examples.html
164.2
KB
-rw-r--r--
2023-12-18 11:36
unittest.mock.html
293.06
KB
-rw-r--r--
2023-12-18 11:36
unix.html
11.5
KB
-rw-r--r--
2023-12-18 11:36
urllib.error.html
14.13
KB
-rw-r--r--
2023-12-18 11:36
urllib.html
9.34
KB
-rw-r--r--
2023-12-18 11:36
urllib.parse.html
74.54
KB
-rw-r--r--
2023-12-18 11:36
urllib.request.html
173.05
KB
-rw-r--r--
2023-12-18 11:36
urllib.robotparser.html
16.75
KB
-rw-r--r--
2023-12-18 11:36
uu.html
11.92
KB
-rw-r--r--
2023-12-18 11:36
uuid.html
31.21
KB
-rw-r--r--
2023-12-18 11:36
venv.html
72.18
KB
-rw-r--r--
2023-12-18 11:36
warnings.html
49.14
KB
-rw-r--r--
2023-12-18 11:36
wave.html
29.17
KB
-rw-r--r--
2023-12-18 11:36
weakref.html
63.76
KB
-rw-r--r--
2023-12-18 11:36
webbrowser.html
26.27
KB
-rw-r--r--
2023-12-18 11:36
windows.html
10.38
KB
-rw-r--r--
2023-12-18 11:36
winreg.html
65.17
KB
-rw-r--r--
2023-12-18 11:36
winsound.html
20.77
KB
-rw-r--r--
2023-12-18 11:36
wsgiref.html
92.28
KB
-rw-r--r--
2023-12-18 11:36
xdrlib.html
32.96
KB
-rw-r--r--
2023-12-18 11:36
xml.dom.html
95.28
KB
-rw-r--r--
2023-12-18 11:36
xml.dom.minidom.html
40.51
KB
-rw-r--r--
2023-12-18 11:36
xml.dom.pulldom.html
23.65
KB
-rw-r--r--
2023-12-18 11:36
xml.etree.elementtree.html
132.32
KB
-rw-r--r--
2023-12-18 11:36
xml.html
18.81
KB
-rw-r--r--
2023-12-18 11:36
xml.sax.handler.html
41.66
KB
-rw-r--r--
2023-12-18 11:36
xml.sax.html
24.92
KB
-rw-r--r--
2023-12-18 11:36
xml.sax.reader.html
44.79
KB
-rw-r--r--
2023-12-18 11:36
xml.sax.utils.html
16.53
KB
-rw-r--r--
2023-12-18 11:36
xmlrpc.client.html
70.26
KB
-rw-r--r--
2023-12-18 11:36
xmlrpc.html
8.33
KB
-rw-r--r--
2023-12-18 11:36
xmlrpc.server.html
48.04
KB
-rw-r--r--
2023-12-18 11:36
zipapp.html
44.05
KB
-rw-r--r--
2023-12-18 11:36
zipfile.html
78.16
KB
-rw-r--r--
2023-12-18 11:36
zipimport.html
22.51
KB
-rw-r--r--
2023-12-18 11:36
zlib.html
33.75
KB
-rw-r--r--
2023-12-18 11:36
Save
Rename
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>15.1. hashlib — Secure hashes and message digests — Python 3.6.7 documentation</title> <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 3.6.7 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="next" title="15.2. hmac — Keyed-Hashing for Message Authentication" href="hmac.html" /> <link rel="prev" title="15. Cryptographic Services" href="crypto.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> <link rel="canonical" href="https://docs.python.org/3/library/hashlib.html" /> <script type="text/javascript" src="../_static/copybutton.js"></script> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="hmac.html" title="15.2. hmac — Keyed-Hashing for Message Authentication" accesskey="N">next</a> |</li> <li class="right" > <a href="crypto.html" title="15. Cryptographic Services" accesskey="P">previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li> <a href="../index.html">3.6.7 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> <li class="nav-item nav-item-2"><a href="crypto.html" accesskey="U">15. Cryptographic Services</a> »</li> <li class="right"> <div class="inline-search" style="display: none" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('.inline-search').show(0);</script> | </li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="module-hashlib"> <span id="hashlib-secure-hashes-and-message-digests"></span><h1>15.1. <a class="reference internal" href="#module-hashlib" title="hashlib: Secure hash and message digest algorithms."><code class="xref py py-mod docutils literal notranslate"><span class="pre">hashlib</span></code></a> — Secure hashes and message digests<a class="headerlink" href="#module-hashlib" title="Permalink to this headline">¶</a></h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.6/Lib/hashlib.py">Lib/hashlib.py</a></p> <span class="target" id="index-0"></span><hr class="docutils" /> <p>This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet <span class="target" id="index-1"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc1321.html"><strong>RFC 1321</strong></a>). The terms “secure hash” and “message digest” are interchangeable. Older algorithms were called message digests. The modern term is secure hash.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">If you want the adler32 or crc32 hash functions, they are available in the <a class="reference internal" href="zlib.html#module-zlib" title="zlib: Low-level interface to compression and decompression routines compatible with gzip."><code class="xref py py-mod docutils literal notranslate"><span class="pre">zlib</span></code></a> module.</p> </div> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">Some algorithms have known hash collision weaknesses, refer to the “See also” section at the end.</p> </div> <div class="section" id="hash-algorithms"> <span id="id1"></span><h2>15.1.1. Hash algorithms<a class="headerlink" href="#hash-algorithms" title="Permalink to this headline">¶</a></h2> <p>There is one constructor method named for each type of <em class="dfn">hash</em>. All return a hash object with the same simple interface. For example: use <code class="xref py py-func docutils literal notranslate"><span class="pre">sha256()</span></code> to create a SHA-256 hash object. You can now feed this object with <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like objects</span></a> (normally <a class="reference internal" href="stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a>) using the <code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code> method. At any point you can ask it for the <em class="dfn">digest</em> of the concatenation of the data fed to it so far using the <code class="xref py py-meth docutils literal notranslate"><span class="pre">digest()</span></code> or <code class="xref py py-meth docutils literal notranslate"><span class="pre">hexdigest()</span></code> methods.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">For better multithreading performance, the Python <a class="reference internal" href="../glossary.html#term-gil"><span class="xref std std-term">GIL</span></a> is released for data larger than 2047 bytes at object creation or on update.</p> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Feeding string objects into <code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code> is not supported, as hashes work on bytes, not on characters.</p> </div> <p id="index-2">Constructors for hash algorithms that are always present in this module are <code class="xref py py-func docutils literal notranslate"><span class="pre">sha1()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha224()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha256()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha384()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha512()</span></code>, <a class="reference internal" href="#hashlib.blake2b" title="hashlib.blake2b"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2b()</span></code></a>, and <a class="reference internal" href="#hashlib.blake2s" title="hashlib.blake2s"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2s()</span></code></a>. <code class="xref py py-func docutils literal notranslate"><span class="pre">md5()</span></code> is normally available as well, though it may be missing if you are using a rare “FIPS compliant” build of Python. Additional algorithms may also be available depending upon the OpenSSL library that Python uses on your platform. On most platforms the <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_224()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_256()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_384()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_512()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_128()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_256()</span></code> are also available.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 3.6: </span>SHA3 (Keccak) and SHAKE constructors <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_224()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_256()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_384()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">sha3_512()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_128()</span></code>, <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_256()</span></code>.</p> </div> <div class="versionadded"> <p><span class="versionmodified">New in version 3.6: </span><a class="reference internal" href="#hashlib.blake2b" title="hashlib.blake2b"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2b()</span></code></a> and <a class="reference internal" href="#hashlib.blake2s" title="hashlib.blake2s"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2s()</span></code></a> were added.</p> </div> <p>For example, to obtain the digest of the byte string <code class="docutils literal notranslate"><span class="pre">b'Nobody</span> <span class="pre">inspects</span> <span class="pre">the</span> <span class="pre">spammish</span> <span class="pre">repetition'</span></code>:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">hashlib</span> <span class="gp">>>> </span><span class="n">m</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha256</span><span class="p">()</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s2">"Nobody inspects"</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s2">" the spammish repetition"</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">digest</span><span class="p">()</span> <span class="go">b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">digest_size</span> <span class="go">32</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">block_size</span> <span class="go">64</span> </pre></div> </div> <p>More condensed:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">hashlib</span><span class="o">.</span><span class="n">sha224</span><span class="p">(</span><span class="sa">b</span><span class="s2">"Nobody inspects the spammish repetition"</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'</span> </pre></div> </div> <dl class="function"> <dt id="hashlib.new"> <code class="descclassname">hashlib.</code><code class="descname">new</code><span class="sig-paren">(</span><em>name</em><span class="optional">[</span>, <em>data</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.new" title="Permalink to this definition">¶</a></dt> <dd><p>Is a generic constructor that takes the string <em>name</em> of the desired algorithm as its first parameter. It also exists to allow access to the above listed hashes as well as any other algorithms that your OpenSSL library may offer. The named constructors are much faster than <a class="reference internal" href="#hashlib.new" title="hashlib.new"><code class="xref py py-func docutils literal notranslate"><span class="pre">new()</span></code></a> and should be preferred.</p> </dd></dl> <p>Using <a class="reference internal" href="#hashlib.new" title="hashlib.new"><code class="xref py py-func docutils literal notranslate"><span class="pre">new()</span></code></a> with an algorithm provided by OpenSSL:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s1">'ripemd160'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s2">"Nobody inspects the spammish repetition"</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc'</span> </pre></div> </div> <p>Hashlib provides the following constant attributes:</p> <dl class="data"> <dt id="hashlib.algorithms_guaranteed"> <code class="descclassname">hashlib.</code><code class="descname">algorithms_guaranteed</code><a class="headerlink" href="#hashlib.algorithms_guaranteed" title="Permalink to this definition">¶</a></dt> <dd><p>A set containing the names of the hash algorithms guaranteed to be supported by this module on all platforms. Note that ‘md5’ is in this list despite some upstream vendors offering an odd “FIPS compliant” Python build that excludes it.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 3.2.</span></p> </div> </dd></dl> <dl class="data"> <dt id="hashlib.algorithms_available"> <code class="descclassname">hashlib.</code><code class="descname">algorithms_available</code><a class="headerlink" href="#hashlib.algorithms_available" title="Permalink to this definition">¶</a></dt> <dd><p>A set containing the names of the hash algorithms that are available in the running Python interpreter. These names will be recognized when passed to <a class="reference internal" href="#hashlib.new" title="hashlib.new"><code class="xref py py-func docutils literal notranslate"><span class="pre">new()</span></code></a>. <a class="reference internal" href="#hashlib.algorithms_guaranteed" title="hashlib.algorithms_guaranteed"><code class="xref py py-attr docutils literal notranslate"><span class="pre">algorithms_guaranteed</span></code></a> will always be a subset. The same algorithm may appear multiple times in this set under different names (thanks to OpenSSL).</p> <div class="versionadded"> <p><span class="versionmodified">New in version 3.2.</span></p> </div> </dd></dl> <p>The following values are provided as constant attributes of the hash objects returned by the constructors:</p> <dl class="data"> <dt id="hashlib.hash.digest_size"> <code class="descclassname">hash.</code><code class="descname">digest_size</code><a class="headerlink" href="#hashlib.hash.digest_size" title="Permalink to this definition">¶</a></dt> <dd><p>The size of the resulting hash in bytes.</p> </dd></dl> <dl class="data"> <dt id="hashlib.hash.block_size"> <code class="descclassname">hash.</code><code class="descname">block_size</code><a class="headerlink" href="#hashlib.hash.block_size" title="Permalink to this definition">¶</a></dt> <dd><p>The internal block size of the hash algorithm in bytes.</p> </dd></dl> <p>A hash object has the following attributes:</p> <dl class="attribute"> <dt id="hashlib.hash.name"> <code class="descclassname">hash.</code><code class="descname">name</code><a class="headerlink" href="#hashlib.hash.name" title="Permalink to this definition">¶</a></dt> <dd><p>The canonical name of this hash, always lowercase and always suitable as a parameter to <a class="reference internal" href="#hashlib.new" title="hashlib.new"><code class="xref py py-func docutils literal notranslate"><span class="pre">new()</span></code></a> to create another hash of this type.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 3.4: </span>The name attribute has been present in CPython since its inception, but until Python 3.4 was not formally specified, so may not exist on some platforms.</p> </div> </dd></dl> <p>A hash object has the following methods:</p> <dl class="method"> <dt id="hashlib.hash.update"> <code class="descclassname">hash.</code><code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.hash.update" title="Permalink to this definition">¶</a></dt> <dd><p>Update the hash object with the <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a>. Repeated calls are equivalent to a single call with the concatenation of all the arguments: <code class="docutils literal notranslate"><span class="pre">m.update(a);</span> <span class="pre">m.update(b)</span></code> is equivalent to <code class="docutils literal notranslate"><span class="pre">m.update(a+b)</span></code>.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 3.1: </span>The Python GIL is released to allow other threads to run while hash updates on data larger than 2047 bytes is taking place when using hash algorithms supplied by OpenSSL.</p> </div> </dd></dl> <dl class="method"> <dt id="hashlib.hash.digest"> <code class="descclassname">hash.</code><code class="descname">digest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.hash.digest" title="Permalink to this definition">¶</a></dt> <dd><p>Return the digest of the data passed to the <a class="reference internal" href="#hashlib.hash.update" title="hashlib.hash.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a> method so far. This is a bytes object of size <a class="reference internal" href="#hashlib.hash.digest_size" title="hashlib.hash.digest_size"><code class="xref py py-attr docutils literal notranslate"><span class="pre">digest_size</span></code></a> which may contain bytes in the whole range from 0 to 255.</p> </dd></dl> <dl class="method"> <dt id="hashlib.hash.hexdigest"> <code class="descclassname">hash.</code><code class="descname">hexdigest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.hash.hexdigest" title="Permalink to this definition">¶</a></dt> <dd><p>Like <a class="reference internal" href="#hashlib.hash.digest" title="hashlib.hash.digest"><code class="xref py py-meth docutils literal notranslate"><span class="pre">digest()</span></code></a> except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments.</p> </dd></dl> <dl class="method"> <dt id="hashlib.hash.copy"> <code class="descclassname">hash.</code><code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.hash.copy" title="Permalink to this definition">¶</a></dt> <dd><p>Return a copy (“clone”) of the hash object. This can be used to efficiently compute the digests of data sharing a common initial substring.</p> </dd></dl> </div> <div class="section" id="shake-variable-length-digests"> <h2>15.1.2. SHAKE variable length digests<a class="headerlink" href="#shake-variable-length-digests" title="Permalink to this headline">¶</a></h2> <p>The <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_128()</span></code> and <code class="xref py py-func docutils literal notranslate"><span class="pre">shake_256()</span></code> algorithms provide variable length digests with length_in_bits//2 up to 128 or 256 bits of security. As such, their digest methods require a length. Maximum length is not limited by the SHAKE algorithm.</p> <dl class="method"> <dt id="hashlib.shake.digest"> <code class="descclassname">shake.</code><code class="descname">digest</code><span class="sig-paren">(</span><em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.shake.digest" title="Permalink to this definition">¶</a></dt> <dd><p>Return the digest of the data passed to the <code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code> method so far. This is a bytes object of size <em>length</em> which may contain bytes in the whole range from 0 to 255.</p> </dd></dl> <dl class="method"> <dt id="hashlib.shake.hexdigest"> <code class="descclassname">shake.</code><code class="descname">hexdigest</code><span class="sig-paren">(</span><em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.shake.hexdigest" title="Permalink to this definition">¶</a></dt> <dd><p>Like <a class="reference internal" href="#hashlib.shake.digest" title="hashlib.shake.digest"><code class="xref py py-meth docutils literal notranslate"><span class="pre">digest()</span></code></a> except the digest is returned as a string object of double length, containing only hexadecimal digits. This may be used to exchange the value safely in email or other non-binary environments.</p> </dd></dl> </div> <div class="section" id="key-derivation"> <h2>15.1.3. Key derivation<a class="headerlink" href="#key-derivation" title="Permalink to this headline">¶</a></h2> <p>Key derivation and key stretching algorithms are designed for secure password hashing. Naive algorithms such as <code class="docutils literal notranslate"><span class="pre">sha1(password)</span></code> are not resistant against brute-force attacks. A good password hashing function must be tunable, slow, and include a <a class="reference external" href="https://en.wikipedia.org/wiki/Salt_%28cryptography%29">salt</a>.</p> <dl class="function"> <dt id="hashlib.pbkdf2_hmac"> <code class="descclassname">hashlib.</code><code class="descname">pbkdf2_hmac</code><span class="sig-paren">(</span><em>hash_name</em>, <em>password</em>, <em>salt</em>, <em>iterations</em>, <em>dklen=None</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.pbkdf2_hmac" title="Permalink to this definition">¶</a></dt> <dd><p>The function provides PKCS#5 password-based key derivation function 2. It uses HMAC as pseudorandom function.</p> <p>The string <em>hash_name</em> is the desired name of the hash digest algorithm for HMAC, e.g. ‘sha1’ or ‘sha256’. <em>password</em> and <em>salt</em> are interpreted as buffers of bytes. Applications and libraries should limit <em>password</em> to a sensible length (e.g. 1024). <em>salt</em> should be about 16 or more bytes from a proper source, e.g. <a class="reference internal" href="os.html#os.urandom" title="os.urandom"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.urandom()</span></code></a>.</p> <p>The number of <em>iterations</em> should be chosen based on the hash algorithm and computing power. As of 2013, at least 100,000 iterations of SHA-256 are suggested.</p> <p><em>dklen</em> is the length of the derived key. If <em>dklen</em> is <code class="docutils literal notranslate"><span class="pre">None</span></code> then the digest size of the hash algorithm <em>hash_name</em> is used, e.g. 64 for SHA-512.</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">hashlib</span><span class="o">,</span> <span class="nn">binascii</span> <span class="gp">>>> </span><span class="n">dk</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">pbkdf2_hmac</span><span class="p">(</span><span class="s1">'sha256'</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'password'</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'salt'</span><span class="p">,</span> <span class="mi">100000</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">binascii</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="n">dk</span><span class="p">)</span> <span class="go">b'0394a2ede332c9a13eb82e9b24631604c31df978b4e2f0fbd2c549944f9d79a5'</span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified">New in version 3.4.</span></p> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">A fast implementation of <em>pbkdf2_hmac</em> is available with OpenSSL. The Python implementation uses an inline version of <a class="reference internal" href="hmac.html#module-hmac" title="hmac: Keyed-Hashing for Message Authentication (HMAC) implementation"><code class="xref py py-mod docutils literal notranslate"><span class="pre">hmac</span></code></a>. It is about three times slower and doesn’t release the GIL.</p> </div> </dd></dl> <dl class="function"> <dt id="hashlib.scrypt"> <code class="descclassname">hashlib.</code><code class="descname">scrypt</code><span class="sig-paren">(</span><em>password</em>, <em>*</em>, <em>salt</em>, <em>n</em>, <em>r</em>, <em>p</em>, <em>maxmem=0</em>, <em>dklen=64</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.scrypt" title="Permalink to this definition">¶</a></dt> <dd><p>The function provides scrypt password-based key derivation function as defined in <span class="target" id="index-3"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7914.html"><strong>RFC 7914</strong></a>.</p> <p><em>password</em> and <em>salt</em> must be <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like objects</span></a>. Applications and libraries should limit <em>password</em> to a sensible length (e.g. 1024). <em>salt</em> should be about 16 or more bytes from a proper source, e.g. <a class="reference internal" href="os.html#os.urandom" title="os.urandom"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.urandom()</span></code></a>.</p> <p><em>n</em> is the CPU/Memory cost factor, <em>r</em> the block size, <em>p</em> parallelization factor and <em>maxmem</em> limits memory (OpenSSL 1.1.0 defaults to 32 MB). <em>dklen</em> is the length of the derived key.</p> <p>Availability: OpenSSL 1.1+</p> <div class="versionadded"> <p><span class="versionmodified">New in version 3.6.</span></p> </div> </dd></dl> </div> <div class="section" id="blake2"> <h2>15.1.4. BLAKE2<a class="headerlink" href="#blake2" title="Permalink to this headline">¶</a></h2> <p id="index-4"><a class="reference external" href="https://blake2.net">BLAKE2</a> is a cryptographic hash function defined in <span class="target" id="index-5"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7693.html"><strong>RFC 7693</strong></a> that comes in two flavors:</p> <ul class="simple"> <li><strong>BLAKE2b</strong>, optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes,</li> <li><strong>BLAKE2s</strong>, optimized for 8- to 32-bit platforms and produces digests of any size between 1 and 32 bytes.</li> </ul> <p>BLAKE2 supports <strong>keyed mode</strong> (a faster and simpler replacement for <a class="reference external" href="https://en.wikipedia.org/wiki/Hash-based_message_authentication_code">HMAC</a>), <strong>salted hashing</strong>, <strong>personalization</strong>, and <strong>tree hashing</strong>.</p> <p>Hash objects from this module follow the API of standard library’s <a class="reference internal" href="#module-hashlib" title="hashlib: Secure hash and message digest algorithms."><code class="xref py py-mod docutils literal notranslate"><span class="pre">hashlib</span></code></a> objects.</p> <div class="section" id="creating-hash-objects"> <h3>15.1.4.1. Creating hash objects<a class="headerlink" href="#creating-hash-objects" title="Permalink to this headline">¶</a></h3> <p>New hash objects are created by calling constructor functions:</p> <dl class="function"> <dt id="hashlib.blake2b"> <code class="descclassname">hashlib.</code><code class="descname">blake2b</code><span class="sig-paren">(</span><em>data=b''</em>, <em>*</em>, <em>digest_size=64</em>, <em>key=b''</em>, <em>salt=b''</em>, <em>person=b''</em>, <em>fanout=1</em>, <em>depth=1</em>, <em>leaf_size=0</em>, <em>node_offset=0</em>, <em>node_depth=0</em>, <em>inner_size=0</em>, <em>last_node=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.blake2b" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="function"> <dt id="hashlib.blake2s"> <code class="descclassname">hashlib.</code><code class="descname">blake2s</code><span class="sig-paren">(</span><em>data=b''</em>, <em>*</em>, <em>digest_size=32</em>, <em>key=b''</em>, <em>salt=b''</em>, <em>person=b''</em>, <em>fanout=1</em>, <em>depth=1</em>, <em>leaf_size=0</em>, <em>node_offset=0</em>, <em>node_depth=0</em>, <em>inner_size=0</em>, <em>last_node=False</em><span class="sig-paren">)</span><a class="headerlink" href="#hashlib.blake2s" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>These functions return the corresponding hash objects for calculating BLAKE2b or BLAKE2s. They optionally take these general parameters:</p> <ul class="simple"> <li><em>data</em>: initial chunk of data to hash, which must be <a class="reference internal" href="../glossary.html#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a>. It can be passed only as positional argument.</li> <li><em>digest_size</em>: size of output digest in bytes.</li> <li><em>key</em>: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for BLAKE2s).</li> <li><em>salt</em>: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s).</li> <li><em>person</em>: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes for BLAKE2s).</li> </ul> <p>The following table shows limits for general parameters (in bytes):</p> <table border="1" class="docutils"> <colgroup> <col width="15%" /> <col width="24%" /> <col width="17%" /> <col width="20%" /> <col width="24%" /> </colgroup> <thead valign="bottom"> <tr class="row-odd"><th class="head">Hash</th> <th class="head">digest_size</th> <th class="head">len(key)</th> <th class="head">len(salt)</th> <th class="head">len(person)</th> </tr> </thead> <tbody valign="top"> <tr class="row-even"><td>BLAKE2b</td> <td>64</td> <td>64</td> <td>16</td> <td>16</td> </tr> <tr class="row-odd"><td>BLAKE2s</td> <td>32</td> <td>32</td> <td>8</td> <td>8</td> </tr> </tbody> </table> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">BLAKE2 specification defines constant lengths for salt and personalization parameters, however, for convenience, this implementation accepts byte strings of any size up to the specified length. If the length of the parameter is less than specified, it is padded with zeros, thus, for example, <code class="docutils literal notranslate"><span class="pre">b'salt'</span></code> and <code class="docutils literal notranslate"><span class="pre">b'salt\x00'</span></code> is the same value. (This is not the case for <em>key</em>.)</p> </div> <p>These sizes are available as module <a class="reference internal" href="#constants">constants</a> described below.</p> <p>Constructor functions also accept the following tree hashing parameters:</p> <ul class="simple"> <li><em>fanout</em>: fanout (0 to 255, 0 if unlimited, 1 in sequential mode).</li> <li><em>depth</em>: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential mode).</li> <li><em>leaf_size</em>: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in sequential mode).</li> <li><em>node_offset</em>: node offset (0 to 2**64-1 for BLAKE2b, 0 to 2**48-1 for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode).</li> <li><em>node_depth</em>: node depth (0 to 255, 0 for leaves, or in sequential mode).</li> <li><em>inner_size</em>: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 in sequential mode).</li> <li><em>last_node</em>: boolean indicating whether the processed node is the last one (<cite>False</cite> for sequential mode).</li> </ul> <div class="figure"> <img alt="Explanation of tree mode parameters." src="../_images/hashlib-blake2-tree.png" /> </div> <p>See section 2.10 in <a class="reference external" href="https://blake2.net/blake2_20130129.pdf">BLAKE2 specification</a> for comprehensive review of tree hashing.</p> </div> <div class="section" id="constants"> <h3>15.1.4.2. Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h3> <dl class="data"> <dt id="hashlib.blake2b.SALT_SIZE"> <code class="descclassname">blake2b.</code><code class="descname">SALT_SIZE</code><a class="headerlink" href="#hashlib.blake2b.SALT_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="data"> <dt id="hashlib.blake2s.SALT_SIZE"> <code class="descclassname">blake2s.</code><code class="descname">SALT_SIZE</code><a class="headerlink" href="#hashlib.blake2s.SALT_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Salt length (maximum length accepted by constructors).</p> <dl class="data"> <dt id="hashlib.blake2b.PERSON_SIZE"> <code class="descclassname">blake2b.</code><code class="descname">PERSON_SIZE</code><a class="headerlink" href="#hashlib.blake2b.PERSON_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="data"> <dt id="hashlib.blake2s.PERSON_SIZE"> <code class="descclassname">blake2s.</code><code class="descname">PERSON_SIZE</code><a class="headerlink" href="#hashlib.blake2s.PERSON_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Personalization string length (maximum length accepted by constructors).</p> <dl class="data"> <dt id="hashlib.blake2b.MAX_KEY_SIZE"> <code class="descclassname">blake2b.</code><code class="descname">MAX_KEY_SIZE</code><a class="headerlink" href="#hashlib.blake2b.MAX_KEY_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="data"> <dt id="hashlib.blake2s.MAX_KEY_SIZE"> <code class="descclassname">blake2s.</code><code class="descname">MAX_KEY_SIZE</code><a class="headerlink" href="#hashlib.blake2s.MAX_KEY_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Maximum key size.</p> <dl class="data"> <dt id="hashlib.blake2b.MAX_DIGEST_SIZE"> <code class="descclassname">blake2b.</code><code class="descname">MAX_DIGEST_SIZE</code><a class="headerlink" href="#hashlib.blake2b.MAX_DIGEST_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="data"> <dt id="hashlib.blake2s.MAX_DIGEST_SIZE"> <code class="descclassname">blake2s.</code><code class="descname">MAX_DIGEST_SIZE</code><a class="headerlink" href="#hashlib.blake2s.MAX_DIGEST_SIZE" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Maximum digest size that the hash function can output.</p> </div> <div class="section" id="examples"> <h3>15.1.4.3. Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> <div class="section" id="simple-hashing"> <h4>15.1.4.3.1. Simple hashing<a class="headerlink" href="#simple-hashing" title="Permalink to this headline">¶</a></h4> <p>To calculate hash of some data, you should first construct a hash object by calling the appropriate constructor function (<a class="reference internal" href="#hashlib.blake2b" title="hashlib.blake2b"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2b()</span></code></a> or <a class="reference internal" href="#hashlib.blake2s" title="hashlib.blake2s"><code class="xref py py-func docutils literal notranslate"><span class="pre">blake2s()</span></code></a>), then update it with the data by calling <code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code> on the object, and, finally, get the digest out of the object by calling <code class="xref py py-meth docutils literal notranslate"><span class="pre">digest()</span></code> (or <code class="xref py py-meth docutils literal notranslate"><span class="pre">hexdigest()</span></code> for hex-encoded string).</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">()</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'Hello world'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'</span> </pre></div> </div> <p>As a shortcut, you can pass the first chunk of data to update directly to the constructor as the positional argument:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">blake2b</span><span class="p">(</span><span class="sa">b</span><span class="s1">'Hello world'</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'</span> </pre></div> </div> <p>You can call <a class="reference internal" href="#hashlib.hash.update" title="hashlib.hash.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">hash.update()</span></code></a> as many times as you need to iteratively update the hash:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">items</span> <span class="o">=</span> <span class="p">[</span><span class="sa">b</span><span class="s1">'Hello'</span><span class="p">,</span> <span class="sa">b</span><span class="s1">' '</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'world'</span><span class="p">]</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">()</span> <span class="gp">>>> </span><span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">items</span><span class="p">:</span> <span class="gp">... </span> <span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">item</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'6ff843ba685842aa82031d3f53c48b66326df7639a63d128974c5c14f31a0f33343a8c65551134ed1ae0f2b0dd2bb495dc81039e3eeb0aa1bb0388bbeac29183'</span> </pre></div> </div> </div> <div class="section" id="using-different-digest-sizes"> <h4>15.1.4.3.2. Using different digest sizes<a class="headerlink" href="#using-different-digest-sizes" title="Permalink to this headline">¶</a></h4> <p>BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to 32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without changing the size of output, we can tell BLAKE2b to produce 20-byte digests:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'Replacing SHA1 with the more secure function'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'d24f26cf8de66472d58d4e1b1774b4c9158b1f4c'</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">digest_size</span> <span class="go">20</span> <span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">h</span><span class="o">.</span><span class="n">digest</span><span class="p">())</span> <span class="go">20</span> </pre></div> </div> <p>Hash objects with different digest sizes have completely different outputs (shorter hashes are <em>not</em> prefixes of longer hashes); BLAKE2b and BLAKE2s produce different outputs even if the output length is the same:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span><span class="p">,</span> <span class="n">blake2s</span> <span class="gp">>>> </span><span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'6fa1d8fcfd719046d762'</span> <span class="gp">>>> </span><span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">11</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'eb6ec15daf9546254f0809'</span> <span class="gp">>>> </span><span class="n">blake2s</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'1bf21a98c78a1c376ae9'</span> <span class="gp">>>> </span><span class="n">blake2s</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">11</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'567004bf96e4a25773ebf4'</span> </pre></div> </div> </div> <div class="section" id="keyed-hashing"> <h4>15.1.4.3.3. Keyed hashing<a class="headerlink" href="#keyed-hashing" title="Permalink to this headline">¶</a></h4> <p>Keyed hashing can be used for authentication as a faster and simpler replacement for <a class="reference external" href="http://en.wikipedia.org/wiki/Hash-based_message_authentication_code">Hash-based message authentication code</a> (HMAC). BLAKE2 can be securely used in prefix-MAC mode thanks to the indifferentiability property inherited from BLAKE.</p> <p>This example shows how to get a (hex-encoded) 128-bit authentication code for message <code class="docutils literal notranslate"><span class="pre">b'message</span> <span class="pre">data'</span></code> with key <code class="docutils literal notranslate"><span class="pre">b'pseudorandom</span> <span class="pre">key'</span></code>:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="sa">b</span><span class="s1">'pseudorandom key'</span><span class="p">,</span> <span class="n">digest_size</span><span class="o">=</span><span class="mi">16</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'message data'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'3d363ff7401e02026f4a4687d4863ced'</span> </pre></div> </div> <p>As a practical example, a web application can symmetrically sign cookies sent to users and later verify them to make sure they weren’t tampered with:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hmac</span> <span class="k">import</span> <span class="n">compare_digest</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="n">SECRET_KEY</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'pseudorandomly generated server secret key'</span> <span class="gp">>>> </span><span class="n">AUTH_SIZE</span> <span class="o">=</span> <span class="mi">16</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="k">def</span> <span class="nf">sign</span><span class="p">(</span><span class="n">cookie</span><span class="p">):</span> <span class="gp">... </span> <span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="n">AUTH_SIZE</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="n">SECRET_KEY</span><span class="p">)</span> <span class="gp">... </span> <span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">cookie</span><span class="p">)</span> <span class="gp">... </span> <span class="k">return</span> <span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">)</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="k">def</span> <span class="nf">verify</span><span class="p">(</span><span class="n">cookie</span><span class="p">,</span> <span class="n">sig</span><span class="p">):</span> <span class="gp">... </span> <span class="n">good_sig</span> <span class="o">=</span> <span class="n">sign</span><span class="p">(</span><span class="n">cookie</span><span class="p">)</span> <span class="gp">... </span> <span class="k">return</span> <span class="n">compare_digest</span><span class="p">(</span><span class="n">good_sig</span><span class="p">,</span> <span class="n">sig</span><span class="p">)</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="n">cookie</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'user-alice'</span> <span class="gp">>>> </span><span class="n">sig</span> <span class="o">=</span> <span class="n">sign</span><span class="p">(</span><span class="n">cookie</span><span class="p">)</span> <span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="s2">"</span><span class="si">{0}</span><span class="s2">,</span><span class="si">{1}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">cookie</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">),</span> <span class="n">sig</span><span class="p">))</span> <span class="go">user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'</span> <span class="gp">>>> </span><span class="n">verify</span><span class="p">(</span><span class="n">cookie</span><span class="p">,</span> <span class="n">sig</span><span class="p">)</span> <span class="go">True</span> <span class="gp">>>> </span><span class="n">verify</span><span class="p">(</span><span class="sa">b</span><span class="s1">'user-bob'</span><span class="p">,</span> <span class="n">sig</span><span class="p">)</span> <span class="go">False</span> <span class="gp">>>> </span><span class="n">verify</span><span class="p">(</span><span class="n">cookie</span><span class="p">,</span> <span class="sa">b</span><span class="s1">'0102030405060708090a0b0c0d0e0f00'</span><span class="p">)</span> <span class="go">False</span> </pre></div> </div> <p>Even though there’s a native keyed hashing mode, BLAKE2 can, of course, be used in HMAC construction with <a class="reference internal" href="hmac.html#module-hmac" title="hmac: Keyed-Hashing for Message Authentication (HMAC) implementation"><code class="xref py py-mod docutils literal notranslate"><span class="pre">hmac</span></code></a> module:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">hmac</span><span class="o">,</span> <span class="nn">hashlib</span> <span class="gp">>>> </span><span class="n">m</span> <span class="o">=</span> <span class="n">hmac</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="sa">b</span><span class="s1">'secret key'</span><span class="p">,</span> <span class="n">digestmod</span><span class="o">=</span><span class="n">hashlib</span><span class="o">.</span><span class="n">blake2s</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'message'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">m</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'</span> </pre></div> </div> </div> <div class="section" id="randomized-hashing"> <h4>15.1.4.3.4. Randomized hashing<a class="headerlink" href="#randomized-hashing" title="Permalink to this headline">¶</a></h4> <p>By setting <em>salt</em> parameter users can introduce randomization to the hash function. Randomized hashing is useful for protecting against collision attacks on the hash function used in digital signatures.</p> <blockquote> <div><p>Randomized hashing is designed for situations where one party, the message preparer, generates all or part of a message to be signed by a second party, the message signer. If the message preparer is able to find cryptographic hash function collisions (i.e., two messages producing the same hash value), then they might prepare meaningful versions of the message that would produce the same hash value and digital signature, but with different results (e.g., transferring $1,000,000 to an account, rather than $10). Cryptographic hash functions have been designed with collision resistance as a major goal, but the current concentration on attacking cryptographic hash functions may result in a given cryptographic hash function providing less collision resistance than expected. Randomized hashing offers the signer additional protection by reducing the likelihood that a preparer can generate two or more messages that ultimately yield the same hash value during the digital signature generation process — even if it is practical to find collisions for the hash function. However, the use of randomized hashing may reduce the amount of security provided by a digital signature when all portions of the message are prepared by the signer.</p> <p>(<a class="reference external" href="http://csrc.nist.gov/publications/nistpubs/800-106/NIST-SP-800-106.pdf">NIST SP-800-106 “Randomized Hashing for Digital Signatures”</a>)</p> </div></blockquote> <p>In BLAKE2 the salt is processed as a one-time input to the hash function during initialization, rather than as an input to each compression function.</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last"><em>Salted hashing</em> (or just hashing) with BLAKE2 or any other general-purpose cryptographic hash function, such as SHA-256, is not suitable for hashing passwords. See <a class="reference external" href="https://blake2.net/#qa">BLAKE2 FAQ</a> for more information.</p> </div> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">os</span> <span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">msg</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'some message'</span> <span class="gp">>>> </span><span class="c1"># Calculate the first hash with a random salt.</span> <span class="gp">>>> </span><span class="n">salt1</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">urandom</span><span class="p">(</span><span class="n">blake2b</span><span class="o">.</span><span class="n">SALT_SIZE</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h1</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">salt</span><span class="o">=</span><span class="n">salt1</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h1</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> <span class="gp">>>> </span><span class="c1"># Calculate the second hash with a different random salt.</span> <span class="gp">>>> </span><span class="n">salt2</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">urandom</span><span class="p">(</span><span class="n">blake2b</span><span class="o">.</span><span class="n">SALT_SIZE</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h2</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">salt</span><span class="o">=</span><span class="n">salt2</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h2</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span> <span class="gp">>>> </span><span class="c1"># The digests are different.</span> <span class="gp">>>> </span><span class="n">h1</span><span class="o">.</span><span class="n">digest</span><span class="p">()</span> <span class="o">!=</span> <span class="n">h2</span><span class="o">.</span><span class="n">digest</span><span class="p">()</span> <span class="go">True</span> </pre></div> </div> </div> <div class="section" id="personalization"> <h4>15.1.4.3.5. Personalization<a class="headerlink" href="#personalization" title="Permalink to this headline">¶</a></h4> <p>Sometimes it is useful to force hash function to produce different digests for the same input for different purposes. Quoting the authors of the Skein hash function:</p> <blockquote> <div><p>We recommend that all application designers seriously consider doing this; we have seen many protocols where a hash that is computed in one part of the protocol can be used in an entirely different part because two hash computations were done on similar or related data, and the attacker can force the application to make the hash inputs the same. Personalizing each hash function used in the protocol summarily stops this type of attack.</p> <p>(<a class="reference external" href="http://www.skein-hash.info/sites/default/files/skein1.3.pdf">The Skein Hash Function Family</a>, p. 21)</p> </div></blockquote> <p>BLAKE2 can be personalized by passing bytes to the <em>person</em> argument:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="gp">>>> </span><span class="n">FILES_HASH_PERSON</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'MyApp Files Hash'</span> <span class="gp">>>> </span><span class="n">BLOCK_HASH_PERSON</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">'MyApp Block Hash'</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">32</span><span class="p">,</span> <span class="n">person</span><span class="o">=</span><span class="n">FILES_HASH_PERSON</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'the same content'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'</span> <span class="gp">>>> </span><span class="n">h</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">32</span><span class="p">,</span> <span class="n">person</span><span class="o">=</span><span class="n">BLOCK_HASH_PERSON</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="sa">b</span><span class="s1">'the same content'</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'</span> </pre></div> </div> <p>Personalization together with the keyed mode can also be used to derive different keys from a single one.</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2s</span> <span class="gp">>>> </span><span class="kn">from</span> <span class="nn">base64</span> <span class="k">import</span> <span class="n">b64decode</span><span class="p">,</span> <span class="n">b64encode</span> <span class="gp">>>> </span><span class="n">orig_key</span> <span class="o">=</span> <span class="n">b64decode</span><span class="p">(</span><span class="sa">b</span><span class="s1">'Rm5EPJai72qcK3RGBpW3vPNfZy5OZothY+kHY6h21KM='</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">enc_key</span> <span class="o">=</span> <span class="n">blake2s</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="n">orig_key</span><span class="p">,</span> <span class="n">person</span><span class="o">=</span><span class="sa">b</span><span class="s1">'kEncrypt'</span><span class="p">)</span><span class="o">.</span><span class="n">digest</span><span class="p">()</span> <span class="gp">>>> </span><span class="n">mac_key</span> <span class="o">=</span> <span class="n">blake2s</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="n">orig_key</span><span class="p">,</span> <span class="n">person</span><span class="o">=</span><span class="sa">b</span><span class="s1">'kMAC'</span><span class="p">)</span><span class="o">.</span><span class="n">digest</span><span class="p">()</span> <span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">b64encode</span><span class="p">(</span><span class="n">enc_key</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">))</span> <span class="go">rbPb15S/Z9t+agffno5wuhB77VbRi6F9Iv2qIxU7WHw=</span> <span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">b64encode</span><span class="p">(</span><span class="n">mac_key</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s1">'utf-8'</span><span class="p">))</span> <span class="go">G9GtHFE1YluXY1zWPlYk1e/nWfu0WSEb0KRcjhDeP/o=</span> </pre></div> </div> </div> <div class="section" id="tree-mode"> <h4>15.1.4.3.6. Tree mode<a class="headerlink" href="#tree-mode" title="Permalink to this headline">¶</a></h4> <p>Here’s an example of hashing a minimal tree with two leaf nodes:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span> <span class="mi">10</span> <span class="o">/</span> \ <span class="mi">00</span> <span class="mi">01</span> </pre></div> </div> <p>This example uses 64-byte internal digests, and returns the 32-byte final digest:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">hashlib</span> <span class="k">import</span> <span class="n">blake2b</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="n">FANOUT</span> <span class="o">=</span> <span class="mi">2</span> <span class="gp">>>> </span><span class="n">DEPTH</span> <span class="o">=</span> <span class="mi">2</span> <span class="gp">>>> </span><span class="n">LEAF_SIZE</span> <span class="o">=</span> <span class="mi">4096</span> <span class="gp">>>> </span><span class="n">INNER_SIZE</span> <span class="o">=</span> <span class="mi">64</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="n">buf</span> <span class="o">=</span> <span class="nb">bytearray</span><span class="p">(</span><span class="mi">6000</span><span class="p">)</span> <span class="go">>>></span> <span class="gp">>>> </span><span class="c1"># Left leaf</span> <span class="gp">... </span><span class="n">h00</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">buf</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="n">LEAF_SIZE</span><span class="p">],</span> <span class="n">fanout</span><span class="o">=</span><span class="n">FANOUT</span><span class="p">,</span> <span class="n">depth</span><span class="o">=</span><span class="n">DEPTH</span><span class="p">,</span> <span class="gp">... </span> <span class="n">leaf_size</span><span class="o">=</span><span class="n">LEAF_SIZE</span><span class="p">,</span> <span class="n">inner_size</span><span class="o">=</span><span class="n">INNER_SIZE</span><span class="p">,</span> <span class="gp">... </span> <span class="n">node_offset</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">node_depth</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">last_node</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="gp">>>> </span><span class="c1"># Right leaf</span> <span class="gp">... </span><span class="n">h01</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">buf</span><span class="p">[</span><span class="n">LEAF_SIZE</span><span class="p">:],</span> <span class="n">fanout</span><span class="o">=</span><span class="n">FANOUT</span><span class="p">,</span> <span class="n">depth</span><span class="o">=</span><span class="n">DEPTH</span><span class="p">,</span> <span class="gp">... </span> <span class="n">leaf_size</span><span class="o">=</span><span class="n">LEAF_SIZE</span><span class="p">,</span> <span class="n">inner_size</span><span class="o">=</span><span class="n">INNER_SIZE</span><span class="p">,</span> <span class="gp">... </span> <span class="n">node_offset</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">node_depth</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">last_node</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="gp">>>> </span><span class="c1"># Root node</span> <span class="gp">... </span><span class="n">h10</span> <span class="o">=</span> <span class="n">blake2b</span><span class="p">(</span><span class="n">digest_size</span><span class="o">=</span><span class="mi">32</span><span class="p">,</span> <span class="n">fanout</span><span class="o">=</span><span class="n">FANOUT</span><span class="p">,</span> <span class="n">depth</span><span class="o">=</span><span class="n">DEPTH</span><span class="p">,</span> <span class="gp">... </span> <span class="n">leaf_size</span><span class="o">=</span><span class="n">LEAF_SIZE</span><span class="p">,</span> <span class="n">inner_size</span><span class="o">=</span><span class="n">INNER_SIZE</span><span class="p">,</span> <span class="gp">... </span> <span class="n">node_offset</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">node_depth</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">last_node</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">h10</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">h00</span><span class="o">.</span><span class="n">digest</span><span class="p">())</span> <span class="gp">>>> </span><span class="n">h10</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">h01</span><span class="o">.</span><span class="n">digest</span><span class="p">())</span> <span class="gp">>>> </span><span class="n">h10</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span> <span class="go">'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'</span> </pre></div> </div> </div> </div> <div class="section" id="credits"> <h3>15.1.4.4. Credits<a class="headerlink" href="#credits" title="Permalink to this headline">¶</a></h3> <p><a class="reference external" href="https://blake2.net">BLAKE2</a> was designed by <em>Jean-Philippe Aumasson</em>, <em>Samuel Neves</em>, <em>Zooko Wilcox-O’Hearn</em>, and <em>Christian Winnerlein</em> based on <a class="reference external" href="https://en.wikipedia.org/wiki/NIST_hash_function_competition">SHA-3</a> finalist <a class="reference external" href="https://131002.net/blake/">BLAKE</a> created by <em>Jean-Philippe Aumasson</em>, <em>Luca Henzen</em>, <em>Willi Meier</em>, and <em>Raphael C.-W. Phan</em>.</p> <p>It uses core algorithm from <a class="reference external" href="https://cr.yp.to/chacha.html">ChaCha</a> cipher designed by <em>Daniel J. Bernstein</em>.</p> <p>The stdlib implementation is based on <a class="reference external" href="https://pythonhosted.org/pyblake2/">pyblake2</a> module. It was written by <em>Dmitry Chestnykh</em> based on C implementation written by <em>Samuel Neves</em>. The documentation was copied from <a class="reference external" href="https://pythonhosted.org/pyblake2/">pyblake2</a> and written by <em>Dmitry Chestnykh</em>.</p> <p>The C code was partly rewritten for Python by <em>Christian Heimes</em>.</p> <p>The following public domain dedication applies for both C hash function implementation, extension code, and this documentation:</p> <blockquote> <div><p>To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.</p> <p>You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <a class="reference external" href="http://creativecommons.org/publicdomain/zero/1.0/">http://creativecommons.org/publicdomain/zero/1.0/</a>.</p> </div></blockquote> <p>The following people have helped with development or contributed their changes to the project and the public domain according to the Creative Commons Public Domain Dedication 1.0 Universal:</p> <ul class="simple"> <li><em>Alexandr Sokolovskiy</em></li> </ul> <div class="admonition seealso"> <p class="first admonition-title">See also</p> <dl class="last docutils"> <dt>Module <a class="reference internal" href="hmac.html#module-hmac" title="hmac: Keyed-Hashing for Message Authentication (HMAC) implementation"><code class="xref py py-mod docutils literal notranslate"><span class="pre">hmac</span></code></a></dt> <dd>A module to generate message authentication codes using hashes.</dd> <dt>Module <a class="reference internal" href="base64.html#module-base64" title="base64: RFC 3548: Base16, Base32, Base64 Data Encodings; Base85 and Ascii85"><code class="xref py py-mod docutils literal notranslate"><span class="pre">base64</span></code></a></dt> <dd>Another way to encode binary hashes for non-binary environments.</dd> <dt><a class="reference external" href="https://blake2.net">https://blake2.net</a></dt> <dd>Official BLAKE2 website.</dd> <dt><a class="reference external" href="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf">http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf</a></dt> <dd>The FIPS 180-2 publication on Secure Hash Algorithms.</dd> <dt><a class="reference external" href="https://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms">https://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms</a></dt> <dd>Wikipedia article with information on which algorithms have known issues and what that means regarding their use.</dd> <dt><a class="reference external" href="https://www.ietf.org/rfc/rfc2898.txt">https://www.ietf.org/rfc/rfc2898.txt</a></dt> <dd>PKCS #5: Password-Based Cryptography Specification Version 2.0</dd> </dl> </div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">15.1. <code class="docutils literal notranslate"><span class="pre">hashlib</span></code> — Secure hashes and message digests</a><ul> <li><a class="reference internal" href="#hash-algorithms">15.1.1. Hash algorithms</a></li> <li><a class="reference internal" href="#shake-variable-length-digests">15.1.2. SHAKE variable length digests</a></li> <li><a class="reference internal" href="#key-derivation">15.1.3. Key derivation</a></li> <li><a class="reference internal" href="#blake2">15.1.4. BLAKE2</a><ul> <li><a class="reference internal" href="#creating-hash-objects">15.1.4.1. Creating hash objects</a></li> <li><a class="reference internal" href="#constants">15.1.4.2. Constants</a></li> <li><a class="reference internal" href="#examples">15.1.4.3. Examples</a><ul> <li><a class="reference internal" href="#simple-hashing">15.1.4.3.1. Simple hashing</a></li> <li><a class="reference internal" href="#using-different-digest-sizes">15.1.4.3.2. Using different digest sizes</a></li> <li><a class="reference internal" href="#keyed-hashing">15.1.4.3.3. Keyed hashing</a></li> <li><a class="reference internal" href="#randomized-hashing">15.1.4.3.4. Randomized hashing</a></li> <li><a class="reference internal" href="#personalization">15.1.4.3.5. Personalization</a></li> <li><a class="reference internal" href="#tree-mode">15.1.4.3.6. Tree mode</a></li> </ul> </li> <li><a class="reference internal" href="#credits">15.1.4.4. Credits</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="crypto.html" title="previous chapter">15. Cryptographic Services</a></p> <h4>Next topic</h4> <p class="topless"><a href="hmac.html" title="next chapter">15.2. <code class="docutils literal notranslate"><span class="pre">hmac</span></code> — Keyed-Hashing for Message Authentication</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li> <a href="https://github.com/python/cpython/blob/3.6/Doc/library/hashlib.rst" rel="nofollow">Show Source </a> </li> </ul> </div> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="hmac.html" title="15.2. hmac — Keyed-Hashing for Message Authentication" >next</a> |</li> <li class="right" > <a href="crypto.html" title="15. Cryptographic Services" >previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li> <a href="../index.html">3.6.7 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> <li class="nav-item nav-item-2"><a href="crypto.html" >15. Cryptographic Services</a> »</li> <li class="right"> <div class="inline-search" style="display: none" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('.inline-search').show(0);</script> | </li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 2001-2023, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="https://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on Dec 18, 2023. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.7.6. </div> </body> </html>