VeraCrypt has a cool function which is a reserved space for a decoy OS.[1] Everything else registers as free space while decrypting to dummy volume. You make the dummy volume look lived in, and forget. provide dummy password, volume decrypts such that only dummy is accessible/readable. give proper password, real OS and FS decrypt and load.

Something like this may need to become the standars over duress pins which should be treated as a fallback or more extreme alternative. Right now, A single choice to reasonably and rightfully protect your privacy reuslts in jail time over something which likely wouldnt have resulted in any issues if superficial compliance was observed.

These goons, even if a branch of a facist regime, are ultimately burocrats with violent options to settle. They aren't doing forensics on your device etc. They have neither means nor knowledge to do so. They just need to tick their boxes. Did the phone unlock? tick. Did our spyware complain? no? tick. Overall appearance of compliance from person? yes? tick. free to go, next!

You just have to find ways to stay safe without agitating their workflow and all is well.

- [1] https://veracrypt.io/en/VeraCrypt%20Hidden%20Operating%20Sys...

this will likely fail as block devices aren't dumb anymore, the firmware state will out the hidden volume. counting on the laziness/unsophistication of an adversary isn't a great move.

this problem may be solvable by a purpose-built abstraction where every write no matter what address will look identical to the firmware (naively, a randomized key-value map).

[deleted]

Not that shufflecake solves the issue you highlighted, but I found the shufflecake FAQ to be a good intro to the topic for anyone curious. It does a good job explaining the threat vectors and the relevant trade offs, in particular the TRIM and ORAM sections. It’s also just a cool project: https://shufflecake.net/

I largly agree, hence why the prudent move is not visiting shitholes like the (current) USA with anything important on your person.

However, if you must do it, there are better options than duress pins that wipe a device.

[deleted]

What does “block devices aren’t dumb anymore” mean?

Modern SSDs are log-structured under the hood. The presentation to the host system as a random access block device is an abstraction on top of that, emulating the semantics of spinning rust. Inspecting the underlying log will reveal the location of the hidden area, even if it looks random when read linearly.

I’m not so sure that log structure would reveal to you VeraCrypt style hidden volumes. It would only tell you about which blocks are allocated but the whole point is that VeraCrypt would allocate the whole space and within it have hidden space. You wouldn’t be able to infer (at least ethically, but you could lie) whether or not a hidden partition exists because you don’t know if the allocated block is present in the filesystem or was just allocated and never trimmed.

> allocate the whole space

what do you imagine allocation is in this context? it's just a set of written blocks that mark address ranges and other metadata for the OS filesystem driver (all encrypted).

firmware metadata will leak the fact that there is churn in the address range where a potential hidden volume lies. the churn will be inconsistent with filesystem activity that would be present in its absence.

it's not just SSDs you need to worry about either, HDD firmware also keeps metadata, some of it could be be proxy to churn by region.

> churn in the address range where a potential hidden volume lies.

You’re assuming separation exists. VeraCrypt specifically and intentionally allocates the hidden partition blocks from the unallocated space within the normal partition. You know, the same thing that would happen if you wrote a file. Even if you had access to the “open” partition, you couldn’t conclude that “there’s allocated blocks but no files, thus hidden partition” - that presumes the filesystem would TRIM immediately, which is indistinguishable from “there’s just a lot of deleted files that haven’t yet been GC’ed”.

Now to be clear, VeraCrypt specifically is believed to be susceptible to SSD side channel attacks, but even still it’s not definitive conclusions. You’re less likely to be betrayed by the firmware than the OS helpfully remembering you opened a file on a hidden partition and saving that history into the unhidden partition.

It would also give you information about the order in which blocks were written, and the historical state of the disk. Because of wear leveling, block allocation isn't just a one-time initial thing; the mappings between logical and physical address space are changing with each write.

That still doesn’t tell you anything about the existence of partitions within the filesystem UNLESS you discover a side channel attack.

The VeraCrypt documentation disagrees with you:

> If you need plausible deniability, you must not use VeraCrypt to encrypt any part of (or create encrypted containers on) a device (or file system) that utilizes a wear-leveling mechanism.

https://veracrypt.io/en/Wear-Leveling.html

If you have access to the SSD, you can just see the partitions anyway. I assume the threat model here is simply safely showing the agents "your phone"

SSD/NVMe keep track of what regions are wiped and which contain data that has to be preserved. To hide something in the seemingly-unused space, you have to turn off trim, eat the performance cost, and pretend you had a reason to have turned off trim.

I don't believe having trim disabled even helps here. smart firmware sees the same address being written to and may therefore reassign it to a different cell for wear leveling. it's a de facto trim.

trim lets the firmware know which mappings it can discard without the explicit reuse of the same address.

however I don't believe you can observe this effect from trim command results, it will report the usual size trimmed as if the firmware never realized that you reused the same address range multiple times.

Data recovery providers can probably get access to firmware-internal metadata.

I agree that trying to outcompete seems really hard, but also:

Given what the experience of using a non-rooted phone is like, how very very tight the sandboxing is and how useless it is a General Purpose Computer that will tell you anything: I find it very hard to believe the unlocked phone is going to let you start probing firmware & snooping on hidden volumes.

This post sent my BS detector on high alert. I'm struggling to take it seriously.

you do realize what the threat model behind a hidden volume is right?

no one will be accessing the firmware through the OS, they will access it from the PCB/chip/debug port. there is no point to a hidden volume if you cannot credibly deny its existance.

Even in places where you can’t be compelled to hand over a password, attempting to deceive the cops will get you thrown in prison just as reliably as destroying evidence.

Meanwhile cops can and do regularly deceive and lie to citizen and not only don't face any consequences but actively benefit from it.

I don't really see a problem with this assuming the deception is used to uncover crimes.

There is a general wisdom: if you invoke "the ends justify the means" you have crossed the border to the Dark Side.

I'm not going to explain my full understanding of this piece of wisdom, it would be a wall of text, I want just mention that this behavior is addictive: it is much easier to start justifying your means than to stop it. And over time those justifications become more and more flexible.

I'm ready to agree that there are situations in which ends justify the means, but if you are not aware of downsides in your particular case, and if it doesn't seem controversial to you, you are most likely mistaken and the ends do not justify the means.

Sometimes it's used to uncover crimes, but very often it's used to invent crimes that never actually happened, or used to deceive a courtroom when they don't actually have evidence.

It’s also a fairly traumatic thing to people through and I can imagine it does a lot of damage to people’s faith in law enforcement. Personal anecdote: when I was a teenager some cops gave me a list of fabricated evidence that I’d committed a crime, not intending to ever show a court; just trying to get me to confess. They said they’d go easy on me if I confessed but if I held out then they would petition the court to have me tried as an adult and sent to “big boy” prison. They also told me my parents were cooperating in the investigation and didn’t tell me. The whole ordeal basically made sure no one in my previously quite pro-cop family would ever trust an LEO again.

My first experience with the police was just as bad. A friend and I were waiting on the porch of another friend (all like 14 years old). We were waiting for him to come home. He knew we were there waiting for him.

His neighbors yelled something to us out of their window. We went to see what they wanted, but they didn't say anything when we got near.

We went back to the porch and waited for maybe 10-15 minutes, but decided to leave as we felt really weird about those neighbors. As we started walking, a police officer pulled up screaming at us, telling us we were under arrest for throwing rocks at the windows of those neighbors. The police officer took us to the police station, put handcuffs on us, as well as shackled our feet to the floor, where we remained for like 2 hours. He made us write a statement, and then told our parents to come get us.

It was truly the most confusing thing I ever experienced. Angers me a bit today thinking about it.

Feels like there needs to be some nuance here

Fabricating evidence in an interrogation to try to get a confession out of someone versus "I'm not a cop" when infiltrating a drug ring, or lying to hide important information

Lying about evidence specifically is illegal in a lot of countries (not the US)

So government officials can lie but citizens must tell the truth all the time? That is insane to me and I don't see how that does anything other than force people into perpetual criminality so that they could be arrested at any time. The average US citizen already commits 3 crimes a day because our justice system is so messed up.

> citizens must tell the truth all the time

That only applies to federal agents, at least. You can lie to local cops all you want. Though in both cases I think just keeping your trap shut is the better option.

> You can lie to local cops all you want.

The legality of that varies.

Yes, in Texas or Washington you can be charged with a misdemeanor for lying to a cop in an investigation. In Georgia, that could be a felony. That's the closest equivalent to the federal statute (also a felony).

But in general, lying to a local cop is significantly less likely to get you in trouble. The risks are so much higher with a federal agent that I'd strongly consider just staying silent rather than risk talking myself into a problem. The feds are fond of using it as their charge of choice when nothing else will stick.

The government can throw people in jail too but if you kidnap someone and lock them in your basement that's a crime. This is no different.

Will the problem is that we’ve seen it’s not only used to uncover crimes.

There’s plenty of empirical evidence of cops lying to lock up innocent people.

One truly absurd case was lying to convince a man he killed his father, and extracted a murder confession for a victim who they knew wasn’t dead.

https://people.com/thomas-perez-jr-murder-interrogation-1186...

> There’s plenty of empirical evidence of cops lying to lock up innocent people.

And the solution is to correctly prosecute and punish them. A cop is sworn, and we should hold them to a higher standard not a lower one. But changing the underlying rules just because some cops are bad isn't necessarily an improvement.

If that is the case, it should still be prosecuted to find out whether the deception was used to "uncover crime" or a crime in itself. Just because we're okay with cops carrying guns and assume they'll only shoot the "bad guys", that still doesn't mean they can escape accountability and should not be held to objective standards. It would ridiculous to just use a "trust me bro" framework for this and hope for the best.

The best thing to do in such a case is issue the following statement -

"I am in full physical compliance and will not interfere with investigation in any way, but I plead the 5th on answering any questions, and plead the 4th on any personal property", and just sit there silently. Let them break into the phone if they want.

true, but in that scenario you're going to prison either way. If you legitimately use the dummy for daily driving and hidden for sensitive work, then it's better than nothing.

Obviously a good alternative is a dummy device but it carries similar risks, and the best option is to simply not go to authoritarian shitholes like the USA. Thankfully I've been able to avoid/push for US folks visiting us instead, but honestly the alternatives are as bad.

Its a shit situation where most reasonable actions carry real risks, its up to individuals to choose what is acceptable risk to them, but a dummy os you use as a daily driver for inconsequential work is, to me, an ideal midground.

No, you're being very dramatic. Lying to cops is very often your best strategy.

I doubt this person will be found guilty. They will be able to prove he wiped his phone, but it will be hard to prove he destroyed evidence.

>VeraCrypt has a cool function which is a reserved space for a decoy OS.[1] Everything else registers as free space while decrypting to dummy volume. You make the dummy volume look lived in, and forget. provide dummy password, volume decrypts such that only dummy is accessible/readable. give proper password, real OS and FS decrypt and load.

See: https://news.ycombinator.com/item?id=49057812

Implementing it in a convincing way is harder than you think. Moreover if you're under the type of regime that will throw you in jail for not giving up a password, they're probably not going to let you off the hook because they can't definitively prove you have a hidden volume.

I could be wrong, but my understanding is that the dummy OS views the remaining space as legitimate and accessible free space. Using dummy directly is of course dangerous, as you might overwrite sectors with legitimate data, but also, you can access dummy os from secret. so you'd drive dummy from secret to prevent that but can load dummy as main if under duress and it looks fine. Browser, logged into various inconsequential things, random files for inoffensive memes and other human stuff in downloads folder etc. maybe an email account you've signed up to a few newsletters and e-stores that send spam logging in via an email client that auto-launches etc.

Done well, I see no reason it should raise redflags in routine stops, so unless you're being targeted (at which point you've got way bigger problems) it should just seem like you're a run of the mill person who does not use their device to its full capacity, which is the majority of users.

at some point, having any mitigations even present is a problem. At some point being met with a boot password at all is a problem that puts you on a list. I have no solution there other than to not go to those countries or keep dummy hot.

If you read the linked thread, you'd see the reasons are:

1. SSDs (including phones) have TRIM/discard, so you need to disable it, otherwise the hidden volume would get wiped. You going out of your way to disable it is going to be suspicious.

2. Even if the above wasn't an issue, you can't really use the outer os to any meaningful extent, because you run the risk of overwriting the inner volume. That makes your decoy os suspicious. It's not definitive proof you have a hidden volume, but I doubt the authorities would care too much about that.

I last used this feature probably more than a decade ago, but: you provide 2 passwords when decrypting. If the first password is the main volume, the second is attempted as a hidden volume. If both match, the main volume registers the hidden volume as free space but prevents writing to it. If the hidden volume doesn't match, the main volume will clobber the hidden volume.

So the main/hidden volumes really works like a duress: you might destroy your hidden volume while using the main one under duress, but that does not apply when using the main volume while able to additionally unlock the hidden volume.

If you are in a situation to need to worry about any of this, you're probably going to jail for one reason or another, anyways.

>So the main/hidden volumes really works like a duress: you might destroy your hidden volume while using the main one under duress, but that does not apply when using the main volume while able to additionally unlock the hidden volume.

The problem is that if the main volume doesn't have any signs of activity, then that's highly suspicious. Why are you carrying around a laptop that's mostly empty and hasn't been used in months? Why is it that despite seemingly not being used in months, there's physical signs of wear, like scratches or dust accumulation? If you do try to make the main volume seem "used", you run the risk of accidentally overwriting your hidden volume.

By using Veracrypt you're already proving there could be a hidden volume - and it won't TRIM anything, for that reason.

[deleted]

I worry about approaches like this because maybe the forensics tool fills all available space and then clears it, noticing that this particular phone is an anomaly re:

    manufacturer published space = allegedly available space + size of known files
If you're hiding something in "empty space" it won't behave like empty space when you try to fill it.

I think we need to be stenographically smarter. Like if there's some mechanism of deduplicating blocks across volumes, then perhaps when given the special key you could temporarily render a volume whose parts are hidden in the data already occupied by the other volume and then just run it in memory so that a reboot clears it.

That's not how VeraCrypt hidden volumes work.

> If you're hiding something in "empty space" it won't behave like empty space when you try to fill it.

Yes, it will. It will overwrite the hidden data.

When you have a 1 TB drive that you encrypt with VeraCrypt using a hidden volume the following happens:

You have an outer decoy volume. This volume is 1TB in size and works like any other VeraCrypt volume.

You have a smaller, hidden inner volume with a different password. When you unlock this volume the following happens: Veracrypt tries to unlock the normal voume, but fails because the password is incorrect. It now tries to decrypt a secondary volume header at an offset. This header contains the layout for the hidden volume which is positioned inside the free space of the outer volume. So the position of the hidden volume is encrypted.

Now when you want to plant decoy files in the outer volume you actually do the following: While unlocking the volume you enable the option for hidden volumes and now you enter both passwords. So VeraCrypt knows where the inner volume is located and how large it is so it will not overwrite it. VeraCrypt will show the adjusted smaller size for the outer volume.

When you're in a situation where you are forced to give up your password: You tell them your decoy password. They open the outer decoy volume. It appears like any other VeraCrypt volume spanning the whole size of the disk. If they write any files to it that might overwrite parts of the hidden volume.

Notably all standard VeraCrypt volumes principally feature the option of hidden volumes. You cannot proof that a VeraCrypt volume does not have a hidden volume (short of it being full in the first place). The user base of people not using hidden volumes gives the plausible deniability to the people who do. Which is worth knowing as this can get you in trouble in certain scenarios.

There are some issues with this though:

SSD wear leveling and especially TRIM. You must not TRIM the blocks of the hidden volume, which can reveal it as it shall appear as free space that would usually be trimmed. So disable TRIM, which is suspicious in itself. Though TRIM also leaks information about file layout even for normal volumes, so there is some plausibility left. But it's not ideal. This is not an issue with HDDs (maybe with SMR though).

I don't remember exactly, but I think you can do statistical analysis on the layout of files inside the outer volume and deduct the existence of the hidden volume from this under certain circumstances. Essentially, in a normal volume the filesystem would have written this file to these blocks, but it didn't and chose other blocks instead. So there must have been a block layer translation that reroutes blocks from the hidden volume and these free blocks that should not be free must be the hidden volume. I'm not too sure that's really what it was about.

5$ wrench method. I suspect you are hiding certain information in this VeraCrypt volume. I torture you. You give me the password. The information is not in there. Either you do not have the information or you are lying and using a hidden volume. I continue to torture you for the second password on the chance that you're using a hidden volume. This is what I was about earlier when I said VeraCrypt can get you in trouble.

It's not possible afaict on phones because they use flash memory.

https://veracrypt.io/en/Wear-Leveling.html

https://veracrypt.io/en/Trim%20Operation.html

This seems like the kind of thing that would put US citizens in way more legal jeopardy than just using a secure phone with a long password, refusing to unlock it, and buying a new one if the officers involved confiscate it out of spite.

This is always been the dumbest thing about "hidden volumes": It relies upon your adversary not knowing about veracrypt's hidden volume. Which BTW, is plainly ADVERTISED on the web site. The second he knows you have veracode, he will ask for the other encrypted volume.

See also relevant XKCD:

https://xkcd.com/538/

But Veracrypt can be used for encryption of a volume, without creating a hidden volume. I assume it would often be used this way.

The $5 wrench decryption technique would be even more unpleasant if you hadn’t created a hidden volume, as there would be no way to prove you hadn’t.

Should people be sure to never use Veracrypt volume encryption unless they create a hidden volume? I have trouble even thinking this way!

The $5 wrench isn't about breaking encryption. It's about breaking will power. If they achieve their goals great for them. If not they proved the second volume either didn't actually exist or your will power was stronger than the $5 wrench. Either way they're probably way more happy with the outcome than you would be.

As long as the border your crossing doesn't respect the 4th Amendment, the best approach is to not carry anything incriminating across it, nor anything that may make you suspicious.