.\" -*- mode: nroff; coding: UTF-8 -*-
.TH ctmg 1 "April 2017" "User Commands"
ctmg \- Simple wrapper around cryptsetup for encrypted containers.
[ \fI\,new\/\fR | \fI\,del\/\fR | \fI\,open\/\fR | \fI\,close\/\fR |
\fI\,list\/\fR | \fI\,help\/\fR ] [\fI\,arguments...\/\fR]
ctmg is an encrypted container manager for GNU/Linux using cryptsetup and
various standard file system utilities. Containers have the extension
\[char46]ct and are mounted at a directory of the same name, but without the
extension. Superuser permissions are required to run this command.
.B n | new | create \fI\,filename size\/\fR
creates a new container file. Both parameters are mandatory.
.B d | del | delete \fI\,filename\/\fR
deletes a container file as well as the mounted directory.
.B o | open \fI\,filename\/\fR
opens a container file and mounts it temporarily in a new directory of the same
.B c | close \fI\,filename\/\fR
deletes the temporary directory. Its contents are stored in the container file.
.B l | list
list all existing mounting directories.
.B h | help | -h | --help
displays a brief summary of how to use this script.
sets the path and file name for the container.
sets the maximum size for the container, the size value must be indicated in the
Create a 100MiB encrypted container called 'foo':
$ ctmg new foo 100MiB
$ ctmg create foo 100MiB
Open a container:
$ ctmg open foo
Close a container:
$ ctmg close foo
Delete a container:
$ ctmg del foo
$ ctmg delete foo
.SH SECURITY CONSIDERATIONS
This script runs as root. As such, you shouldn't run this on paths you don't
trust or paths that could be controlled by malicious users.
Since ctmg uses cryptsetup and the LUKS infrastructure, it uses the Linux block
device encryption APIs. The state of the art in block device encryption, as of
writing, is XTS mode, which is what ctmg uses. But do note that this does not
guarantee, entirely, the integrity of data, just the secrecy. As such, if a
malicious user is able to modify the encrypted content, it is possible this
could result in differing decrypted content without you noticing. So, ctmg is
useful for keeping things secret, but not for guaranteeing the authenticity of
the data. If your laptop gets stolen, sleep safely knowing that your
ctmg-secured data is safe, but if an attacker is actively modifying the .ct file
while you're using it in one way or another, you've got trouble.
In order to conserve space, ctmg uses truncate to make sparse files. This means
that the file grows as it's used. An attacker can therefore see how much of the
container is utilized. If you care about this, it's easy enough to replace the
single call to truncate with a single call to dd if=/dev/urandom to make a
completely full file containing only random data.
Written by Iván Ruvalcaba.
Copyright \(co 2015, Jason A. Donenfeld <Jason@zx2c4.com>
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.