Apple Inc. has refused federal requests to help unlock the phone of San Bernardino gunman Syed Rizwan Farook. But the company turned over data from his phone that Mr. Farook had backed up on its iCloud service.

Soon, that may not be so simple. Apple is working to bolster its encryption so that it won’t be able to decode user information stored in iCloud, according to people familiar with the matter.

Apple's iCloud backup data is used “very significantly and very often” to investigate a technology-facilitated crime, said Edward J. McAndrew, a partner at law firm Ballard Spahr and a former federal prosecutor in Virginia. Backups can provide information already deleted on the phone, he said. A criminal might, for example, try to remove incriminating evidence from his phone after getting wind of an investigation. “This is another example of Apple taking steps to better secure its products, while contemporaneously” reducing its role in government investigations, Mr. McAndrew said.

Related Practices