VeraCrypt icon indicating copy to clipboard operation
VeraCrypt copied to clipboard

Hidden volume file container size limited to 2TB using GUI wizard

Open j2921 opened this issue 9 months ago • 0 comments

Summary

In the GUI wizard

  1. SectorSize is set to TC_SECTOR_SIZE_FILE_HOSTED_VOLUME (VolumeCreationWizard.cpp:701)
  2. There is a check for VolumeSize > TC_MAX_FAT_SECTOR_COUNT * SectorSize (VolumeCreationWizard.cpp:976)
  3. TC_SECTOR_SIZE_FILE_HOSTED_VOLUME = 512
  4. TC_MAX_FAT_SECTOR_COUNT = 0x100000000ULL
  5. This result in a cap of 2TiB when creating an outer container since TC_SECTOR_SIZE_FILE_HOSTED_VOLUME * TC_MAX_FAT_SECTOR_COUNT = 2TiB

Recommendation

Change VolumeCreationWizard.cpp:976 to read: if (SelectedVolumePath.IsDevice() && OuterVolume && VolumeSize > TC_MAX_FAT_SECTOR_COUNT * SectorSize) since the sector check is irrelevant when the container lives in a file

Also this restriction can by bypassed using the command line as noticed by: https://sourceforge.net/p/veracrypt/discussion/technical/thread/383b4bedb0/

VeraCrypt already supports multi TB hidden volumes (on raw disk), so this feature should also be supported in a file container.

If this is acceptable, I can create a PR, please let me know.

Steps to reproduce

  1. Open Veracrypt GUI
  2. Create Volume
  3. Create an encrypted file container -> Next
  4. Hidden VeraCrypt Volume -> Next
  5. Select a file on disk
  6. Encryption Settings -> Next
  7. Volume Size: 3TB
  8. Set a password
  9. Volume format: Any
  10. I will mount only on Linux
  11. Format

Your Environment

Please tell us more about your environment

VeraCrypt version: 1.26.24

Operating system and version: Linux

System type: 64 bit

j2921 avatar Jun 21 '25 07:06 j2921