Governments and law-enforcement agencies have been increasingly eager to access encrypted communications, even if that means undermining public confidence in privacy protection.