Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

A utility for managing LUKS encrypted containers.

Project Description

A utility for managing LUKS encrypted containers.


If you are unfamiliar with LUKS encryption, it is most commonly used to encrypt entire disk partitions. However, it is also capable of encrypting files that can be mounted as a loop device, allowing you to create portable encrypted containers to keep different types of sensitive data isolated.

This script is a simple wrapper to simplify the steps required to create and use these containers.


Root access (via sudo) is required for all commands.

Create a container. The number is the size in megabytes.

$ sudo create work_stuff 100

Open a container. The default moves the container to .<container> and mounts to the container path. Use -m to set an explicit mount path.

$ sudo open work_stuff

Close a container. The default unmounts from the container path and moves the container back to it’s original path. -m to set the mount path is required if it was used when the container was opened.

$ sudo close work_stuff

Expand a container. The number is the amount in megabytes to increase the size of the container by.

$ sudo expand work_stuff 10


pyluks is based on the LUKS specification. Specifically, it requires that cryptsetup be available. It is currently written to use ext4 as the container filesystem. As such, this script will likely only work on Linux systems.

There are no external Python dependencies. The script may be freely copied anywhere, as long as Python 2 or 3 is available.

Release History

Release History

This version
History Node


Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting