Enabling Secure and Privacy Preserving Communications in Smart Grids