So to answer the actual question "It works by turning the engine a little bit to compensate".
I could get prison time for opening mail that is addressed to only my wife.
No you couldn't. Well, I'm assuming you live with your wife and didn't steal the letter from her mailbox. The relevant law is 18 USC S 1702 "Obstruction of correspondence"
Whoever takes any letter, postal card, or package out of any post office or any authorized depository for mail matter, or from any letter or mail carrier, or which has been in any post office or authorized depository, or in the custody of any letter or mail carrier, before it has been delivered to the person to whom it was directed, with design to obstruct the correspondence, or to pry into the business or secrets of another, or opens, secretes, embezzles, or destroys the same, shall be fined under this title or imprisoned not more than five years, or both.
Notice that it includes taking, opening, and destroying, all equally. If it was a felony to open your wife's mail, it would be an equal felony to remove it from the mailbox and bring it inside. It's not a felony. Mostly because this only applies while the mail is in the possession of the post office. Contrary to a related urban legend, your mailbox is not considered property of the post office. Once the letter is placed there, it is considered delievered. Taking mail from somebody else's mailbox is considered "theft" which is not a federal crime. Some states make mail theft worse than regular theft, but it's stealing regardless.
Because the law is "delievered to the person to whom it was directed" it is may still be considered "obstruction of correspondence" if you open or destroy somebody else's mail, if it was delievered to you accidentially. However, the key is still that your intent was to prevent them from getting the mail, or to pry into their secrets. If you get a letter, open it, and realize "hey, who is this from?" you are not a felon. You still need to get it back to the post office so they can deliver it properly (if they put it in the wrong box) or return it to the sender (if the person has moved without a forwarding address), otherwise you are obstructing the deliever (this is the "secreting" part of the law). But again, the law requires intent. It's not a crime if you just forget to do it.
Under the Act of Production Doctrine, the act of an individual in producing documents or materials (e.g., in response to a subpoena) may have a "testimonial aspect" for purposes of the individual's right to assert the Fifth Amendment privilege against self-incrimination to the extent that the individual's act of production provides information not already in the hands of law enforcement personnel about the (1) existence; (2) custody; or (3) authenticity, of the documents or materials produced.
For example, let's ignore computers: You are wanted for wire fraud. The police search your home with a warrant for accounting documents. They find a small fire safe in the back of your attic. They ask for your combo and like a smart criminal you say "lawyer" and nothing else. So they will see if their safe crackers can open it without risking damage to the contents. Lets say it's a sort of safe where you need to blow it open, and this may destroy the documents it might contain. So they need that combo. They go to a judge and want a subpoena for the combonation. Or rather, they subpoena the contents of the safe. You don't have to tell them the combo, but you do have to open the safe for them if you want to keep the combo secret. At least, that's what they get if the judge sides with them. So the question is, where does this fall WRT the Act of Production Doctrine. The safe was in the corner of your attic. It could have been there when you moved in. It could be your roommates. You could be aware of its existence, or not. You could have put its contents inside of it, or not. At this point, the police do not know any of these answers. So by the Act of Production Doctrine, opening the safe would be testifying as to all of these things. Therefore, the Fifth would protect you from this demand. However, if they dust it for prints and find that your prints are all over the tumbler, then you're on shakier ground. The judge may rule that this shows that your control of the safe is now a "forgone conclusion" and issue the subpoena. Of course, you could say "Well yeah, it was here when I moved in, I tried a few obvious combos, they didn't work, I gave up". That will be up to the judge to decide. Contrary to
On the other hand, if instead of saying "lawyer" you said "hahaha, stupid coppers, only I know the combonation, and if you try to crack the safe you will destroy all of the evidence of my many crimes! The Firth will protect me and I'll walk!" then a judge will almost certainly accept your volunteered testimony on the matter and rule that it is a "foregone conclusion" that you know the safe combo (and that you know it contains the documents the police are looking for). So, don't say that.
In this case, the defendant did the second thing, though without all of the "I did it" bits. He admitted the laptop was his, he admitted it contained encrypted emails discussing the allegedly fradulent things the company was doing, and he admitted that he still knows the password. So the legal question was not "can we compel somebody to reveal a key" because that's already legally decided. The question is "is a password a key? or is it just a word?" The judge ruled that a password was a key, and since the defendant was no longer protected by the Act of Production Doctrine due to his own previous testimony, he can be compelled to use that key. This will only apply to you if the Act of Production Doctrine does not protect you.