It's far more complicated than that. Modern encryption uses algorithms that can't be reverse-engineered easily. Depending on the quality of the encryption, cracking it can take quite a lot of time and money. Nothing is perfect, but the point is to make it harder than it would be worth.
In reality, if you're facing trouble with a government, they would be more likely to try to find a way to get you to give up your password. http://xkcd.com/538/
(in the US, that would probably be through trickery or deals)