Trust and reputation approach to smart grid security