The U.S. Department of Homeland Security is creating a center aimed at protecting banks, electric companies and other critical infrastructure against cyberattacks—a threat that now exceeds the danger of a physical attack against the U.S. by a hostile foreign group, Secretary Kirstjen Nielsen said Tuesday.