Google and Apple said they are hardening encryption tactics on devices powered by their mobile operating systems and tossing away the keys.