AI is tearing through some of the hardest problems in mathematics while governments and technology companies scramble to secure their systems. Could these developments be connected?