tcplay Notes

Creating a New Volume

  • Create an empty image with dd
  • Associate a loop device with the image with losetup
  • Use tcplay to create a new TrueCrypt volume on the loop device
$ dd if=/dev/zero of=foo.tc bs=1 count=0 seek=1GiB
$ sudo losetup /dev/loop0 foo.tc
$ sudo tcplay -c -d /dev/loop0 -g -b SERPENT-256-XTS,TWOFISH-256-XTS,AES-256-XTS -y SERPENT-256-XTS,TWOFISH-256-XTS,AES-256-XTS

Creating a Filesystem on a New Volume

  • Use losetup to associate a loop device with an existing image
  • Use tcplay to decrypt the TrueCrypt volume on the loop device and associate it with a cryptdev mapper
  • Create an ext2 filesystem with mke2fs on the cryptdev mapper
  • Repeat this for both normal and hidden volumes
$ sudo losetup /dev/loop0 foo.tc
$ sudo tcplay -m foo -d /dev/loop0
$ sudo mke2fs /dev/mapper/foo

Mounting a Normal Volume

  • Use losetup to associate a loop device with an existing image
  • Use tcplay to decrypt the TrueCrypt volume on the loop device and associate it with a cryptdev mapper
  • Mount the cryptdev mapper on a mount point
$ sudo losetup /dev/loop0 foo.tc
$ sudo tcplay -m foo -d /dev/loop0
$ sudo mount -o nosuid,uid=1000,gid=1000 /dev/mapper/foo /home/you/mnt/foo

Mounting a Hidden Volume

  • Use losetup to associate a loop device with an existing image
  • Use tcplay to decrypt the TrueCrypt volume on the loop device and associate it with a cryptdev mapper, using the -e option to protect the hidden volume
  • Mount the cryptdev mapper on a mount point
$ sudo losetup /dev/loop0 foo.tc
$ sudo tcplay -m foo -e -d /dev/loop0
$ sudo mount -o nosuid,uid=1000,gid=1000 /dev/mapper/foo /home/you/mnt/foo

Unmounting a Volume

  • Unmount the cryptdev mapper/mount point
  • Remove the cryptdev with dmsetup. This may take a while before it becomes available to unmount.
  • Remove the loop device association
$ sudo umount /home/you/mnt/foo
$ sudo dmsetup remove /dev/mapper/foo
$ sudo dmsetup remove /dev/mapper/foo.1
$ sudo dmsetup remove /dev/mapper/foo.0
$ sudo losetup -d /dev/loop0

Sections