The digital locks protecting the world's bank accounts, state secrets and private messages are facing a new test as AI finds ways to tackle the math problems that have long kept encryption secure.