No, they can't. They can force you to let them try to open it, but they can't force you to open it for them.
If you have some mechanism like "if you try to open this incorrectly it destroys the contents", and you intentionally don't disclose that with the expectation that they're going to try and fail and destroy the contents, you might get charged with destruction of evidence.
(EDIT: Replies suggest that disclosure may not suffice.)
News articles suggests this happens a lot at the borders or during customs.
https://www.yesmagazine.org/social-justice/2018/03/23/two-th...
https://www.hecklawoffices.com/blog/2020/11/its-illegal-for-...
Does it only become destruction after you have been informed the police are interested in you? What if you do it before a warrant is issued? What if your device will self destruct if a password is not entered every N days and you withhold that information?
A court on the other hand, can compel you to open something.
An order to unlock something coming from the cops is entirely different, even if they have a warrant. Warrants would allow them to seize a phone, but you don’t have to provide the password.
Actually, the government cannot compel you to give the combination to a safe [1]. If it's locked with a key, not a keypad or combination lock, they can force you to give the key. The distinction is that the former is a product of the mind, while the latter is a physical object. Furthermore, what if you forgot the combination? There's no real way to tell if someone has forgotten the combination or is deliberately withholding it.
The UK's laws to compel people to give up passwords seems to make it a de facto crime to forget one's password. Worse yet, it seems like it's illegal to possess random bytes on your devices. I wonder if the UK would change course if people started emailing random bytes to politicians and other supporters of this law, while giving tips to law enforcement that these individuals are coordinating criminal acts over encrypted communications.
But ... If you're going to compell someone to give up the contents of their mind under threat of being found guilty if their mind isn't working properly, you may as well just do away with trial.
IOW, if you're going to compell speech, just compell the suspect to confess; it's the same thing.
Sounds a bit silly. The location of the key is "a product of the mind." What if you forgot the location of the key?
Is it different from compelling someone to enter a text password to unlock a vault? What if it's self-destructive otherwise?
What happens if the password itself - or act of unlocking - is something self-incriminating (in form, in contents, or otherwise)?
Reminds me of Ian Watkins: https://www.huffingtonpost.co.uk/2013/11/26/lostprophets-sin....
No, they can't
The state can install a keylogger if they have a warrant, and the results of the keylogger can be admitted as evidence.
It’s “you can’t be forced to open it because it requires you saying the password,” not “you can’t be forced to open it because it contains important secrets.”
Right, if they can figure out a way to reveal your secrets without forcing you to say something, they’re allowed to do that (with warrant of course).
A phone is unique thing not because it contains so many secrets, but because you have to give testimony (as opposed to property, like a key) in order to open it, and it's impossible to open by bashing the door down or cutting it open. It's a technological coincidence, not a legal/philosophical doctrine, that makes phones secure against compulsion by law enforcement.