A Privacy Safeguarding Framework For The Smart Grid