Smart grid security is a crucial aspect of protecting the electrical grid that employs advanced technologies, including digital communication, sensors, and automation, to enhance the efficiency and dependability of power distribution. As the adoption of these technologies continues to increase, it is imperative to safeguard smart grid systems against potential cyber-attacks, which could result in power outages, financial losses, and public safety threats. Smart grid security measures encompass encryption, access control, intrusion detection, as well as training and awareness programs for both employees and consumers. By ensuring a secure smart grid system, risks can be mitigated and the resilience of the power infrastructure can be maintained. This Paper represents a scheme to secure the smart grid. In this scheme HMAC (Hashed-Based Message Authentication Code) is used to decrypt the message along with SKDP (Secure Key Distribution Protocol) which secures the from UKS (Unknown Share Key Attack).