How do I hide an encrypted VeraCrypt volume as a playable video file?

I know I can store the encrypted volume as whatever file type I want, but what if I want that file to act as the file type? For example, if I save it as an mp4 file, how can I open the file in a media player (and it will play something) and open it in VeraCrypt?

  • 1
    you will need some intermediate step, it can't be done directly.
    – dandavis
    Sep 8, 2016 at 19:03
  • 1
    Research steganography for tools/examples.
    – HashHazard
    Sep 8, 2016 at 19:37

3 Answers 3


With some intermediate steps it works for some video formats.

Many formats allow "trailing garbage", which either causes an error message after the correct video played, causes garbage output or is just ignored.

When you now append your volume to the video, the video still works. To access the volume, you can e.g. use the device-mapper (when using linux) to create a blockdevice from the file, which has some offset (the length of the video) and then use this.

If you only want to hide the volume (e.g. to put it on a usb stick when traveling) but not use it in this form, you just need a program to split the file at the offset, so you can unpack it on the computer where you want to use it.
There are programs which allow to combine images and rar files, which may work with videos as well. So the easiest solution there might be to pack it into a rar and use such a program.

  • This is called a polyglot file. You might like to read 4:11 from PoC||GTFO, which describes a polyglot that is both a PDF and a TrueCrypt volume. Now, granted, a PDF is particularly easy to use with a polyglot, but it may give you some ideas.
    – forest
    Sep 26, 2018 at 2:29

I know you can edit an mp3 file in a hex editor and extend the file with and encrypted. pdf file. The mp3 will still play and you just have to edit the file with the hex editor to extract the pdf. Should be possible with an mp4.


How do I hide an encrypted VeraCrypt volume as a playable video file?

You can't. Or, at least not out of the box.

What you're asking for is termed steganography, or hiding data within data, without revealing that there's a second, embedded message.

Steganography is completely feasible, even in video. But Veracrypt does not support this. It supports hidden volumes, which will not show up as files, but rather as random noise on the drives unallocated parts. It's not perfect, and has severe drawbacks. And it does not allow storing data inside a video file.

What you're asking is feasible. How feasible depends on how well you want to hide it. You want to hide against cursory searches? Appending a TC container to the end of a video will probably work - but this will fail the instant anyone probes the video bit rate and size of the file. To achieve real steganography you want the signal embedded in a way that looks like random noise - and with video that is likely to need some heavy lifting CPU-wise.

  • The issue isn't that it would be CPU intensive so much as the fact that hiding a non-trivial amount of data in noise requires a huge video file, otherwise it will stick out like a sore thumb.
    – forest
    Jul 27, 2018 at 4:56
  • Video files are huge. But they also use a lot of tricks, like like only encoding difference between key frames. You would probably have to reencode the data in some way for each write...
    – vidarlo
    Jul 27, 2018 at 8:34
  • 1
    Oh I get what you mean now. Yes it would likely require re-encoding some of it. I imagine there would be some clever techniques to reduce the encoding requirements, like only modifying I-frames.
    – forest
    Jul 29, 2018 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.