encryption and passwords are protected under the 5th amendment. We had a child porn case revolve that exact concept come to a close last year. The defendent lost, but the judge made it clear it was because the content was already viewable when it was inspected. He would not have been forced to hand over the information if the device was powered off or locked when it was inspected.
However, the government is also allowed to copy your device contents, and if you don't provide the pass, I've seen nothing that says they are not allowed to brute force it.

