A major cyberattack on big US telecom companies has led officials to recommend that people use encrypted messaging apps.