It's more like they can make you open a safe. It's too bad for you if you kept someone's head in that safe.
Telling someone the encryption key is being compelled to act as a witness against yourself, which the 5th amendment provides protection against (if used).
There's no prospect of this being used to bring about a wrongful conviction through coercing a confession.
It is exactly the same as when a confidential source gives up an address (for example) the source never gets into evidence.
If the key involves a password that you, a human, have memorized in your squishy pink organ, it's privileged under the Fifth Amendment. (This hasn't been tested in court yet, of course. There's no precedent to fall back on.)