The Digital Millennium Copyright Act was written in 1998 to protect digital intellectual property, and forbids most attempts to bypass digital security measures. Every 3 years, the Library of Congress has the ability to create exceptions to the DMCA, thereby legalizing cracking Digital Rights Management.
Excerpt and Link from Ars Technica:
This time, the Library went (comparatively) nuts, allowing widespread bypassing of the CSS encryption on DVDs, declaring iPhone jailbreaking to be “fair use,” and letting consumers crack their legally purchased e-books in order to have them read aloud by computers.
The linked post has a great summary. But the key point has to do with the iPhone, most notably… jailbreaking is officially legal.