4

Can cryptsetup be used to open a veracrypt file like crypsetup/dm-crypt can open luks? What is the correct process ?

Want to make sure other software can open veracrypt file , command line or gui is fine, as long as it can open a veracrypt file.

Tried:

  • sudo cryptsetup tcryptOpen '/media/path/to/veracrypt/file' stuff
  • sudo cryptsetup --type --tcryptOpen ''/media/path/to/veracrypt/file' stuff
  • cryptsetup tcryptOpen '/media/path/to/veracrypt/file' stuff

The @Vojtech Trefny answer below seemed to work, but with an error:

sudo cryptsetup --type tcrypt --veracrypt open '/media/path/to/veracrypt/file' stuff
Enter passphrase for /media/...: 
Device '/media/path/to/veracrypt/file' is too small.

password was able to open the veracrypt file using veracrypt, but not using cryptsetup.

Additional note: This is command allowed me to access veracrypt/truecrypt files using cryptsetup

sudo cryptsetup --type tcrypt open container-to-mount container-name

kenfavors.com has a simple example page that may be useful to anyone having similar problem described above

1

2 Answers 2

3

You are probably mistaking LUKS and cryptsetup. LUKS is a disk encryption format/metadata specification and cryptsetup is a tool (and library) for working with encrypted devices. It was first started for LUKS/dm-crypt but it also supports other formats including TrueCrypt/VeraCrypt, BitLocker and loopaes.

To unlock a VeraCrypt device using cryptsetup use cryptsetup tcryptOpen <device> <name>, details about TrueCrypt/VeraCrypt support are available in the man page, section TCRYPT (TrueCrypt-compatible and VeraCrypt) EXTENSION.

1
  • 2
    Thanks - yes i was confusing cryptsetup with luks........but tried a few different variations of the command you provided, finally ~$ sudo cryptsetup --type tcrypt --veracrypt open <device> <name> to work accepting password, but fails with error Device /media/path/to/veracrypt/file is too small.
    – t09
    Commented Mar 11, 2021 at 0:30
0
  1. You first need to make your veracrypt file into a loop device.
    ls -l /dev/loo*
    
  2. Pick one not presently used or make a new one:
    losetup /dev/loop8 /your/encrypted/veracrypt/file.hc
    
  3. Cryptsetup as you would for any other veracrypt device eg:
    cryptsetup open --type tcrypt --veracrypt-query-pim /dev/loop8 unlockeddevice
    
  4. Unlock with your PIM and password. Then mount:
    mount /dev/mapper/unlockeddevice /mnt/myveracryptdrive
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .