Earlier quoted context omitted.
I don't know the legal implications, but if the duress password unlocks your device and simply deletes a directory or two, and the officer only asked you to unlock your device (without a warrant, by the way), how is that lying?
Despite rumors to the contrary, the police aren’t stupid. They are trained to ask questions in ways that elicit a confession or falsehood. The simplest example is asking “Do you know why I pulled you over?”. Typically, people spontaneously confess to speeding, sometimes they break down and admit that someone is wrapped up in a rug in the trunk. The courts have consistently ruled that customs is different and you can…
I was asked this once, after I read a hilarious reddit comment, and found myself in a similar situation. I looked at the cop and said "it's not because of the pot in my trunk is it?". "Step out and open your trunk, sir". He opened the trunk to find a crock pot I had just purchased. I could tell he was flipping through emotions from stifling laughter to being highly annoyed. They eventually let me go and told me to slow down with a half smirk.
I don't recommend doing this, and I have zero plans to ever do it again as it wasn't as simple as stepping out and showing my guilt/joke. I was detained, backup units showed up, even a K9. They didn't search the inside of my car, but they did inspect other items inside the trunk to make sure I wasn't pulling a fast one on them.