My question pertains to the somewhat recent emergence/increase of technological searches present at US borders. The premise I am operating under is that, a), while there are limits to this, border agents can demand passwords to phones, laptops or similar devices, and b), you face annoying to potentially serious consequences (being detained, not allowed to enter the US, and/or having your device confiscated for a period of time or indefinitely). I don't have what I would consider sufficient sources for this information (i.e. for documenting what is actually legal*, certainly there are many sources documenting that such events have occurred).
*I am aware that the law in this case may change or become more clearly defined, as matters seem to have a degree of fuzziness now.
All of that out of the way, consider somebody (a US citizen) crossing the US border who, knowing they might be stopped and asked for their password by border agents, set an unusually long password. Specifically, one occupying several letter-sized pages. When asked for their password, they provide a pre-printed copy of this password (the rationale is that typing such a password would likely take many attempts and be highly irritating, since you cannot see mistakes on most computer login screens - the individual perhaps intends this to be a protest). What, if any, legal consequences could result from doing this? I am aware that there are significant risks of practical consequences resulting from this, such as being detained regardless of law, however, I am interested in the legal aspect.
In a different scenario, someone (again a US citizen) chooses to instead infect their computer with malware which is programmed to spread to any connected devices (say, if border agents connect USB devices with forensic tools to collect data). Perhaps this person too thinks of this as a protest. What are the potential legal consequences of doing this?
I should specify that while I am somewhat flexible with my language by saying "potential" consequences, an answer merely stating the relevant computer misuse laws for the latter, or failure-to-comply laws for the former isn't exactly what I am looking for - I am interested in an analysis that specifically accounts for the context of these border searches.
I have no intention of doing any of these things, nor would I endorse them being done.