{"id":44752676,"url":"https://github.com/srichs/python-veracrypt","last_synced_at":"2026-02-15T23:16:32.315Z","repository":{"id":293598825,"uuid":"984536671","full_name":"srichs/python-veracrypt","owner":"srichs","description":"A cross-platform Python wrapper for the VeraCrypt CLI.","archived":false,"fork":false,"pushed_at":"2026-02-08T19:03:35.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T20:02:19.897Z","etag":null,"topics":["crossplatform","python","veracrypt-cli"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srichs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-16T05:08:52.000Z","updated_at":"2026-02-08T18:51:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba383d09-7ce9-4885-b7c5-070084052a33","html_url":"https://github.com/srichs/python-veracrypt","commit_stats":null,"previous_names":["srichs/python-veracrypt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srichs/python-veracrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srichs%2Fpython-veracrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srichs%2Fpython-veracrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srichs%2Fpython-veracrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srichs%2Fpython-veracrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srichs","download_url":"https://codeload.github.com/srichs/python-veracrypt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srichs%2Fpython-veracrypt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29492029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crossplatform","python","veracrypt-cli"],"created_at":"2026-02-15T23:16:31.747Z","updated_at":"2026-02-15T23:16:32.310Z","avatar_url":"https://github.com/srichs.png","language":"Python","readme":"# python-veracrypt\n\n[![CI](https://github.com/srichs/python-veracrypt/actions/workflows/ci.yml/badge.svg)](https://github.com/srichs/python-veracrypt/actions/workflows/ci.yml)\n[![Docs](https://img.shields.io/github/actions/workflow/status/srichs/python-veracrypt/ci.yml?branch=main\u0026label=docs)](https://github.com/srichs/python-veracrypt/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/python-veracrypt.svg)](https://pypi.org/project/python-veracrypt/)\n\n## Overview\n\nA 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.\n\n## Installation\n\nInstall the Python package with pip:\n\n```bash\npip install python-veracrypt\n```\n\nYou 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:\n\n- [VeraCrypt Downloads](https://veracrypt.eu/en/Downloads.html)\n\n### Prerequisites\n\n- Verify the VeraCrypt CLI is available by running `veracrypt --version` (or the equivalent command on your OS).\n- Ensure the process has permission to mount volumes (administrator or sudo may be required).\n\n## Supported Platforms\n\n- Windows\n- macOS\n- Linux\n\nMount operations may require administrator or sudo permissions depending on your OS and system configuration.\n\n## Usage\n\n```python\nfrom veracrypt import VeraCrypt, FileSystem\nimport os\n\n\nvc = VeraCrypt()\nvolume_path = os.path.join('C:\\\\', 'Users', 'user', 'Desktop', 'test.vc')\n# Create a volume\nresult = vc.create_volume(volume_path, 'SecretPassword', 5 * 1024 * 1024, filesystem=FileSystem.EXFAT)\n\n# Mount a volume\nresult = vc.mount_volume(volume_path, 'SecretPassword', 'H', options=['/beep'])\n# Dismount a volume\nresult = vc.dismount_volume('H', options=['/beep'])\n\n# Custom command - Pay close attention when using this\nresult = vc.command(['/volume', volume_path, '/letter', 'H', '/password', 'SecretPassword', '/beep', '/quit', '/silent', '/force'])\n```\n\n### Quick start checklist\n\n1. Install VeraCrypt and confirm the CLI is on your PATH.\n2. Choose a volume path and mount target (drive letter on Windows or mount point on Unix).\n3. Use the helper methods to create, mount, and dismount volumes.\n\n### Linux/macOS example\n\n```python\nfrom veracrypt import VeraCrypt, FileSystem\n\nvc = VeraCrypt()\nvolume_path = \"/home/user/secure/test.vc\"\nmount_point = \"/mnt/veracrypt\"\n\nresult = vc.create_volume(volume_path, \"SecretPassword\", 5 * 1024 * 1024, filesystem=FileSystem.EXFAT)\nresult = vc.mount_volume(volume_path, \"SecretPassword\", mount_point, options=[\"--filesystem=exfat\"])\nresult = vc.dismount_volume(mount_point)\n```\n\n### Handling results\n\nThe methods on `VeraCrypt` return `subprocess.CompletedProcess` objects. You can inspect the return code and stderr to verify success:\n\n```python\nresult = vc.mount_volume(volume_path, \"SecretPassword\", \"H\", options=[\"/beep\"])\nif result.returncode != 0:\n    print(\"Mount failed:\", result.stderr)\n```\n\n## Security\n\n### Passwords\n\nOn nix based systems the password is passed in using `--stdin`, so the password will not appear in bash history or log files. \n\nOn 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.\n\n### Best practices\n\n- Avoid hardcoding passwords in source code. Prefer secure prompts or environment variables.\n- Avoid logging the full command line if it contains sensitive values.\n- Ensure mounted volumes are dismounted when not in use.\n\n## Documentation\n\nSphinx documentation lives in the `docs/sphinx/` directory. To build HTML docs locally:\n\n```bash\npip install \".[docs]\"\nsphinx-build -b html docs/sphinx docs/sphinx/_build/html\n```\n\nThe generated docs can be opened from `docs/sphinx/_build/html/index.html`.\n\n### Troubleshooting\n\n- If mounts fail, verify the VeraCrypt CLI works outside Python and that your user has sufficient permissions.\n- If you use a custom VeraCrypt install location, ensure the executable directory is on your PATH.\n\n## Contributing\n\n- Install development dependencies with `pip install -r requirements-dev.txt`.\n- Run tests with `pytest`.\n- Format with `black` and sort imports with `isort`.\n- Lint with `ruff` and type-check with `mypy`.\n\n## License\n\nThis project is licensed under the terms of the LICENSE file in this repository.\n\n## References\n\n1. [VeraCrypt](https://veracrypt.eu)\n\n1. [Arcane Code VeraCrypt on Command Line Windows](https://arcanecode.com/2021/06/14/veracrypt-on-the-command-line-for-windows/)\n\n1. [Arcane Code VeraCrypt on Command Line Linux](https://arcanecode.com/2021/06/21/veracrypt-on-the-command-line-for-ubuntu-linux/)\n\n1. [Arcane Code VeraCrypt on Command Line MacOS](https://arcanecode.com/2021/06/07/3504/)\n\n1. [GitHub - arcanecode/VeraCrypt-CommandLine-Examples](https://github.com/arcanecode/VeraCrypt-CommandLine-Examples)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrichs%2Fpython-veracrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrichs%2Fpython-veracrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrichs%2Fpython-veracrypt/lists"}