bwalex / tc-play

Free and simple TrueCrypt/VeraCrypt Implementation based on dm-crypt
BSD 2-Clause "Simplified" License
551 stars 56 forks source link

Cannot allocate more than 4GB for hidden volume on 5GB disk #64

Closed fourzerofour closed 4 years ago

fourzerofour commented 10 years ago

Any idea why?

% sudo tcplay -z --create --hidden --device=/dev/loop0 --cipher=TWOFISH-256-XTS,AES-256-XTS --pbkdf-prf=whirlpool --cipher-hidden=AES-256-XTS --pbkdf-prf-hidden=whirlpool
Passphrase: 
Repeat passphrase: 
Passphrase for hidden volume: 
Repeat passphrase: 
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  3.5G
Summary of actions:
 - Create outer volume on /dev/loop0
 - Create hidden volume of 3745513472 bytes at end of outer volume

 Are you sure you want to proceed? (y/n) n
User cancelled action(s)
could not create new volume on /dev/loop0

% sudo tcplay -z --create --hidden --device=/dev/loop0 --cipher=TWOFISH-256-XTS,AES-256-XTS --pbkdf-prf=whirlpool --cipher-hidden=AES-256-XTS --pbkdf-prf-hidden=whirlpool
Passphrase: 
Repeat passphrase: 
Passphrase for hidden volume: 
Repeat passphrase: 
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  4G
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  4G
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  4500M
Summary of actions:
 - Create outer volume on /dev/loop0
 - Create hidden volume of 423624704 bytes at end of outer volume

 Are you sure you want to proceed? (y/n) n
User cancelled action(s)
could not create new volume on /dev/loop0
bwalex commented 4 years ago

I can't really reproduce that:

❯ dd if=/dev/zero of=5gvol bs=1M count=5120
5120+0 records in                        
5120+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 3.65334 s, 1.5 GB/s

❯ sudo losetup /dev/loop0 5gvol

❯ sudo ./tcplay -z --create --hidden --device=/dev/loop0 --cipher=AES-256-XTS --pbkdf-prf=whirlpool --cipher-hidden=AES-256-XTS --pbkdf-prf-hidden=whirlpool
Passphrase:                               
Repeat passphrase:        
Passphrase for hidden volume:                                                                                                                                                      
Repeat passphrase: 
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  4.1G
Summary of actions:              
 - Create outer volume on /dev/loop0
 - Create hidden volume of 4399824896 bytes at end of outer volume

 Are you sure you want to proceed? (y/n) y
Creating volume headers...
Depending on your system, this process may take a few minutes as it uses true random data which might take a while to refill
Writing volume headers to disk...
All done!

❯ sudo ./tcplay -z --create --hidden --device=/dev/loop0 --cipher=AES-256-XTS --pbkdf-prf=whirlpool --cipher-hidden=AES-256-XTS --pbkdf-prf-hidden=whirlpool
Passphrase: 
Repeat passphrase: 
Passphrase for hidden volume: 
Repeat passphrase: 
The total volume size of /dev/loop0 is 5 G (bytes)
Size of hidden volume (e.g. 127M):  4.6G
Summary of actions:
 - Create outer volume on /dev/loop0
 - Create hidden volume of 4924112896 bytes at end of outer volume

 Are you sure you want to proceed? (y/n) y
Creating volume headers...
Depending on your system, this process may take a few minutes as it uses true random data which might take a while to refill
Writing volume headers to disk...
All done!