The US has been doing that for years already. There's plenty of stories of people (US citizens included) being detained by border agents in US airports for refusal to provide said agents with access to their devices.
They can detain you and take your device, but they cannot compel you to give up your password, to be clear. As a US Citizen you have a right to re-enter the country.
The letter of the law says you are correct. Reality however disagrees. People who are most definitely US citizens have in fact been put in jail for the simple not-crime of refusing to provide passwords to their devices to law enforcement.