BEIJING - China on Tuesday enacted a controversial national security law to crack down on what Beijing views as subversive activity in Hong Kong, the state-run Xinhua News Agency reported, a move that could jeopardize human rights and freedoms in the former British colony.