vnformat reads and writes vnode disk images, as created and used by vnd(4).
The type of encryption, (if any), and encryption parameters, (key, salt, and number of rounds), can be specified separately for input and output. This allows existing disk image files to be converted between encrypted and unencrypted, as well as between different encryption configurations.
The vnformat utility can also be used to view the actual binary encryption key that is used for encryption or decryption.
The options are as follows:
-i file
Specifies the input file. This should have a file size that is a multiple of 512 bytes. This option is required.
-f keyfile
Specifies a file to read the input key from. This option is mutually exclusive with -k. See the next entry for information about how specifying a key interacts with other options. See the CAVEATS section for important information about reading keys from files.
-k key
Specifies the encryption key for the input. If rounds or saltfile are also specified for the input file, then the supplied key will not be used directly as an input to the encryption algorithm but will instead be passed through a key derivation function first.
-r rounds
Specifies the number of rounds to use during key derivation for the input. The valid range is from 1000 to INT_MAX. If a saltfile is supplied via -s without an explicit rounds parameter, then rounds will default to 1000.
-s saltfile
Specifies the salt file for the input. This should contain 128 bytes of random data, and will be used as an input to the key derivation function mentioned above.
-o file
Specifies the output file. If file does not already exist, it will be created with 0600 permissions. If file already exists and is writable, it will be truncated before writing. This option is required.
-F keyfile
Specifies a file to read the output key from. This option is mutually exclusive with -K. See the entry for -k for information about how specifying a key interacts with other options. See the CAVEATS section for important information about reading keys from files.
-K key
Specifies the encryption key for the output. If rounds or saltfile are also specified for the ouput file, then the supplied key will be used via a key derivation function as described above for the input key.
-R rounds
Specifies the number of rounds to use during key derivation for the output. The valid range is from 1000 to INT_MAX. If a saltfile is supplied via either -S or -T without an explicit rounds parameter, then rounds will default to 1000.
-S saltfile
Specifies the salt file for the output. This should contain 128 bytes of random data, and will be used as an input to the key derivation function.
-T saltfile
This option will write 128 bytes of random data to saltfile and use that as the salt for the key derivation function for the output. This is equivalent to creating such a salt file manually and then specifying it with -S.