SAN FRANCISCO – Yahoo chief Marissa Mayer on Monday said the Internet firm will begin encrypting data to protect users from online snooping.