AFAIK clean-room reverse engineering is sufficient but not always necessary for such an implementation to be allowed, but it does make the fair use argument a bit more difficult. (and of course the DMCA criminalizes any reverse engineering of 'technical safeguards' regardless of how you do it)