An encrypted file cannot, assuming a suitably complex password.
So require proof that the file is not decryptable by other means before you can compel entering a password ;)
You can’t take the fifth before a grand jury. I think there is a certain presumption that the actors are gentlemen that the law assumes. If you feel really strongly about that sort of privacy, you’d be well served to not find yourself in a criminal court trial.
There is both ambiguity and case law here.
If I have a locked container that belongs to my dad, don’t have the key or combo because he is incapacitated, am I a criminal for not giving the police they key and combo?
The police can have a reasonable suspicion that something is in that box, why should that make me a criminal?
The law enforcement argument is "That is ridiculous, the suspect entered the password 50x a day until we seized the device". (And they are probably correct) But justice is supposed to be about "beyond a reasonable doubt". As a juror, I couldn't convict someone of a crime because he asserted that he does not remember a fact.