The emerging Internet of Things (IoT) and bidirectional communications in smart grid are expected to improve smart grid capabilities and electricity management. Because of massive number of IoT devices in smart grid, size of the data to be transmitted increases, that demands a high data rate to meet the real-time smart grid communications requirements. Sub-6 GHz, millimeter-wave (mmWave) technologies, and massive multiple-input multiple-output (MIMO) technologies can meet high data rate demands. However, IoT enabled smart grid is still subject to various security challenges such as eavesdropping, where attackers attempt to overhear the transmitted signals and the jamming attack, where the attacker perturbs the received signals at the receiver. In this paper, our goal is to investigate jamming and eavesdropping attacks while improving secrecy capacity for smart grid communications. Specifically, we propose to employ a hybrid beamforming design for wireless communications in smart energy grid. In previous works, the secrecy capacity is increased by randomly augmenting the source power or setting the system combiners. Unlike state-of-the-art, we design and evaluate the Gradient Ascent algorithm to search for the best combiners/waveform that maximizes the secrecy capacity in smart grid communications. We also study two different optimization scenarios by considering both fixed and variable transmit power. Numerical results are used for performance evaluation and supporting our formal analysis.