A UN treaty called the WIPO Copyright Treaty requires countries to pass laws protecting "software locks" (also called DRM or TPM). Countries around the world have adopted the treaty in different ways: in the US, the Digital Millennium Copyright Act prohibits all circumvention of software locks, even when they don't protect copyright (for example, it would be illegal to for me to break the DRM on a Kindle to access my own novels, were they sold with Kindle DRM).

Brazil has just created the best-ever implementation of WCT. In Brazil's version of the law, you can break DRM without breaking the law, provided you're not also committing a copyright violation. And what's more, any rightsholder who adds a DRM that restricts things that are allowed by Brazilian copyright laws ("fair dealing" or "fair use") faces a fine.

It's a fine and balanced approach to copyright law: your software locks have the power of law where they act to uphold the law. When they take away rights the law gives, they are themselves illegal.

§1º. The same sanction applies, without prejudice to other sanctions set forth by law, to whom, through whatever means: a) hinders or prevents the uses allowed by arts. 46, 47 and 48 of this Act [which addresses limitations to copyright including fair dealing]; or b) hinders or prevents the free use of works, broadcast transmissions and phonograms which have fallen into the public domain.

Brazil's Approach on Anti-Circumvention: Penalties For Hindering Fair Dealing