python-veracrypt 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-veracrypt
3
+ Version: 0.1.0
4
+ Summary: A cross-platform Python wrapper for the VeraCrypt CLI.
5
+ Author-email: srichs <srichs@pm.me>
6
+ License: GNU GPL v3.0
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Provides-Extra: docs
11
+ Requires-Dist: sphinx>=7.2; extra == "docs"
12
+ Dynamic: license-file
13
+
14
+ # python-veracrypt
15
+
16
+ [![CI](https://github.com/srichs/python-veracrypt/actions/workflows/ci.yml/badge.svg)](https://github.com/srichs/python-veracrypt/actions/workflows/ci.yml)
17
+ [![PyPI](https://img.shields.io/pypi/v/python-veracrypt.svg)](https://pypi.org/project/python-veracrypt/)
18
+
19
+ ## Overview
20
+
21
+ A cross platform Python wrapper for the [VeraCrypt](https://veracrypt.eu) CLI. It requires the VeraCrypt application to be installed on your system and it uses the CLI to perform different operations.
22
+
23
+ ## Installation
24
+
25
+ Install the Python package with pip:
26
+
27
+ ```bash
28
+ pip install python-veracrypt
29
+ ```
30
+
31
+ You must also install VeraCrypt and ensure the VeraCrypt CLI is available on your PATH. Refer to the VeraCrypt downloads page for installers and platform details:
32
+
33
+ - [VeraCrypt Downloads](https://veracrypt.eu/en/Downloads.html)
34
+
35
+ ### Prerequisites
36
+
37
+ - Verify the VeraCrypt CLI is available by running `veracrypt --version` (or the equivalent command on your OS).
38
+ - Ensure the process has permission to mount volumes (administrator or sudo may be required).
39
+
40
+ ## Supported Platforms
41
+
42
+ - Windows
43
+ - macOS
44
+ - Linux
45
+
46
+ Mount operations may require administrator or sudo permissions depending on your OS and system configuration.
47
+
48
+ ## Usage
49
+
50
+ ```python
51
+ from veracrypt import VeraCrypt, FileSystem
52
+ import os
53
+
54
+
55
+ vc = VeraCrypt()
56
+ volume_path = os.path.join('C:\\', 'Users', 'user', 'Desktop', 'test.vc')
57
+ # Create a volume
58
+ result = vc.create_volume(volume_path, 'SecretPassword', 5 * 1024 * 1024, filesystem=FileSystem.EXFAT)
59
+
60
+ # Mount a volume
61
+ result = vc.mount_volume(volume_path, 'SecretPassword', 'H', options=['/beep'])
62
+ # Dismount a volume
63
+ result = vc.dismount_volume('H', options=['/beep'])
64
+
65
+ # Custom command - Pay close attention when using this
66
+ result = vc.command(['/volume', volume_path, '/letter', 'H', '/password', 'SecretPassword', '/beep', '/quit', '/silent', '/force'])
67
+ ```
68
+
69
+ ### Quick start checklist
70
+
71
+ 1. Install VeraCrypt and confirm the CLI is on your PATH.
72
+ 2. Choose a volume path and mount target (drive letter on Windows or mount point on Unix).
73
+ 3. Use the helper methods to create, mount, and dismount volumes.
74
+
75
+ ### Linux/macOS example
76
+
77
+ ```python
78
+ from veracrypt import VeraCrypt, FileSystem
79
+
80
+ vc = VeraCrypt()
81
+ volume_path = "/home/user/secure/test.vc"
82
+ mount_point = "/mnt/veracrypt"
83
+
84
+ result = vc.create_volume(volume_path, "SecretPassword", 5 * 1024 * 1024, filesystem=FileSystem.EXFAT)
85
+ result = vc.mount_volume(volume_path, "SecretPassword", mount_point, options=["--filesystem=exfat"])
86
+ result = vc.dismount_volume(mount_point)
87
+ ```
88
+
89
+ ### Handling results
90
+
91
+ The methods on `VeraCrypt` return `subprocess.CompletedProcess` objects. You can inspect the return code and stderr to verify success:
92
+
93
+ ```python
94
+ result = vc.mount_volume(volume_path, "SecretPassword", "H", options=["/beep"])
95
+ if result.returncode != 0:
96
+ print("Mount failed:", result.stderr)
97
+ ```
98
+
99
+ ## Security
100
+
101
+ ### Passwords
102
+
103
+ On nix based systems the password is passed in using `--stdin`, so the password will not appear in bash history or log files.
104
+
105
+ On Windows based systems the password cannot be passed to the CLI using stdin, so care should be taken to ensure that the password will not appear in history or logs. The result that is returned from the basic functional commands of the VeraCrypt class are `subprocess.CompletedProcess` objects, and the password is sanitized on windows in the `args` parameter of the object.
106
+
107
+ ### Best practices
108
+
109
+ - Avoid hardcoding passwords in source code. Prefer secure prompts or environment variables.
110
+ - Avoid logging the full command line if it contains sensitive values.
111
+ - Ensure mounted volumes are dismounted when not in use.
112
+
113
+ ## Documentation
114
+
115
+ Sphinx documentation lives in the `docs/sphinx/` directory. To build HTML docs locally:
116
+
117
+ ```bash
118
+ pip install ".[docs]"
119
+ sphinx-build -b html docs/sphinx docs/sphinx/_build/html
120
+ ```
121
+
122
+ The generated docs can be opened from `docs/sphinx/_build/html/index.html`.
123
+
124
+ ### Troubleshooting
125
+
126
+ - If mounts fail, verify the VeraCrypt CLI works outside Python and that your user has sufficient permissions.
127
+ - If you use a custom VeraCrypt install location, ensure the executable directory is on your PATH.
128
+
129
+ ## Contributing
130
+
131
+ - Install development dependencies with `pip install -r requirements-dev.txt`.
132
+ - Run tests with `pytest`.
133
+ - Format with `black` and sort imports with `isort`.
134
+ - Lint with `ruff` and type-check with `mypy`.
135
+
136
+ ## License
137
+
138
+ This project is licensed under the terms of the LICENSE file in this repository.
139
+
140
+ ## References
141
+
142
+ 1. [VeraCrypt](https://veracrypt.eu)
143
+
144
+ 1. [Arcane Code VeraCrypt on Command Line Windows](https://arcanecode.com/2021/06/14/veracrypt-on-the-command-line-for-windows/)
145
+
146
+ 1. [Arcane Code VeraCrypt on Command Line Linux](https://arcanecode.com/2021/06/21/veracrypt-on-the-command-line-for-ubuntu-linux/)
147
+
148
+ 1. [Arcane Code VeraCrypt on Command Line MacOS](https://arcanecode.com/2021/06/07/3504/)
149
+
150
+ 1. [GitHub - arcanecode/VeraCrypt-CommandLine-Examples](https://github.com/arcanecode/VeraCrypt-CommandLine-Examples)
@@ -0,0 +1,8 @@
1
+ python_veracrypt-0.1.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
2
+ veracrypt/__about__.py,sha256=nfeRdJ9LH1JScMuMlTdJY34ag0OKuXXhgwtZC8f2n2o,275
3
+ veracrypt/__init__.py,sha256=DODA2d5rUrx1Uj5YtOGkm7lig33fnxhHmfzoSMutHYA,161
4
+ veracrypt/veracrypt.py,sha256=GS32f_5xIIwu1n5klGgxfbgiwk_RA2YWoKuiA45Z2eE,22549
5
+ python_veracrypt-0.1.0.dist-info/METADATA,sha256=-RXMuifnyd7l7hEXxPTTnnR8pvr228YLA1kFoUA_nVA,5482
6
+ python_veracrypt-0.1.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
7
+ python_veracrypt-0.1.0.dist-info/top_level.txt,sha256=Avb7D6AWIOBParYmFUy37prsgGfb41pwP209mJdmhMA,10
8
+ python_veracrypt-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+