Australia has passed a law that would require companies to weaken their encryption, a move that could reverberate globally.