They want to take your fingerprints? You don't need to help by lifting your arm. They want you to open a safe? No need to tell them the combination, through they will crack it open if you refuse. Same with encryption keys, you don't need to say anything. Telling the truth? As the accused you're allowed to lie in court however you want.
If you do get sentenced you can get a reduced sentence if the court thinks that you've been cooperative. But you can never get punished simply for the fact that you didn't help with your own prosecution.
Really? I'm interested to know how this works, and how it is not perjury.
There also aren't juries in Germany.
There also isn't cross-examination in Germany.
The English way of law isn't the only way.
I can see no possible correct answer than "yes, absolutely, it is testimonial."
If I may take some minor artistic liberty and change the words without changing the scenario:
Consider a person on trial for murder, and the prosecution believes they wrote down where the body is buried on a piece of paper. The paper's got blood on it and was found next to a hatchet and duct tape. Gee shucks though, it's written in an ancient dialect of Silbo Gomero and they're the last person alive who speaks it. The prosecution would really love to have that evidence for their case. Can they make the defendant translate it for them?
Absolutely not, right? That's clear-as-day 5th amendment, if-I-translate-this-for-you-I'm-incriminating-myself territory.
It is the exact same concept with encryption. There is a piece of information unintelligible to an adversary (prosecutor), that the adversary believes (due to surrounding known evidence) would further their case. The only way to transform the information into something useful for the prosecutor is with the help of the defendant, using knowledge that exists only in the defendant's mind (password).
Asking the defendant to create the evidence against themselves (evidence that does not exist until the defendant creates it, mind you - not something like the contents of a safe where the physical evidence exists whether the defendant wills it or not) is a 100% textbook 5th amendment violation.
I really feel that if someone sees this any other way, they fundamentally misunderstand how encryption works. The documents the prosecution wants do not exist unless the defendant (re)creates them, and you can't ask someone to create evidence (testimony) against themselves (5th amendment, again).
If you stab people, you can wipe the blood off the knife. If you shoot someone, there was not a way to associate a projectile with a firearm. (Assuming the dubious merits of "firearm forensics".) Back in the good ol' 1780s, there's no presecutorial evidence to be gained by inspecting my safe because you cannot show that the knife/gun inside was the murder weapon.
Replace combination by password. Your example still works. If evidence is "locked" on an encrypted storage device and the password is in unencrypted plaintext form, it can be still used to "crack" the encryption without effort.
But could you force the suspect to tell you the safe combination in your example ?
The protection against self-incrimination is/was a protection against being put on trial and being forced to say or give testimony that you took part in or committed a crime. It is not a protection against any and all evidence from being produced against you.
In a previous age, not saying words was enough protection, because evidence was usually physical (objects). The novel problem now is that the types of evidence being protected by passwords (and the method of protection) now are so closely linked that it's quite difficult to say whether being compelled to reveal a password is testimonial.
Suppose a suspect murdered someone and was seen putting the weapon in a safe, where the combination was known to be written in a person's private papers. Those papers could be compelled to be revealed without jeopardizing privilege because the discovery of the combination is not forcing a person to testify. Even compelling the person to reveal the combination might not be testimony. And in any case, the safe could be opened with much effort and a blowtorch.
But now, the safe can never be cracked, and the person's knowledge of the password is the only thing that will open it. The person revealing the password will surely confirm his/her guilt, so it now feels very much like the info/knowledge is self-incriminating testimony.
Modern problems. They need some court resolution at a high level.