-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib_api_doc.txt
68 lines (53 loc) · 1.77 KB
/
lib_api_doc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pycloaking
----------
def cloak_file(in_password,
in_filename,
out_filename,
chunksize=64*1024):
"""
Encrypts a file using AES (CBC mode) with
a key produced from the given password.
Parameters:
in_password:
This password is securely hashed to produce a 32-byte digest.
The digest is used as the AES256 key.
in_filename:
Path name of the input cleartext file
out_filename:
Path name of output ciphertext file.
chunksize:
Sets the size of the read-file chunk which is
used to read and encrypt the file.
Larger chunk sizes can be faster for some files and machines.
The chunksize must be divisible by 16.
Default value: 64k.
Returns:
Elapsed time in seconds
Raises:
ValueError if chunksize mod 16 != 0
IOError if something is wrong with the input or output file
"""
def uncloak_file(in_password,
in_filename,
out_filename,
chunksize=64*1024):
"""
Decrypts a file using AES (CBC mode) with
a key produced from the given password.
Parameters:
in_password:
Same description as for cloak_file.
in_filename:
Path name of the input ciphertext file
out_filename:
Path name of output cleartext file.
chunksize:
Same description as for cloak_file..
Returns:
Elapsed time in seconds
Raises:
ValueError if chunksize mod 16 != 0
IOError if something is wrong with the input or output file
UserWarning if the input file was not created with cloak_file()
or is corrupted
"""