The Emerging Smart Grid: Opportunities for Increased System Reliability and Potential Security Risks