Cyber-physical security of an electric microgrid