E-Commerce or Electronic commerce is the buying and selling of goods and services in which any commercial transactions through wireless electronic devices such as hand-held computers (tablets), mobile phones or laptops is conducted anytime & anywhere via Internet technology. But, E-Commerce transactions or services are suffered by many attacks such as Man in the Middle attack, eavesdropping attacks, and etc. due to the lack of secured security infrastructure. Here, data security is one of the ways to keep the confidential information secure through E-Commerce transactions. In this connection, we have proposed an optimal and efficient data security with the combination of Elgamal cryptosystem and LSB image steganography technique for E-Commerce. In our proposed work, at the merchant side, Elgamal encryption technique is used to protect sensitive information during E-Commerce transactions from intruders and LSB image steganography process is also applied to hide generated Elgamal encrypted data and produce a stego-image (steganography image). Then, DCT (Discrete Cosine Transform) technique through autoencoder is imposed on stego-image to make an optimal image to increase the throughput of the work. After that, the produced optimal image with cipher text is sent to the customer end. At the customer end, first, stego-image is extracted from the optimal image using LSB retrieval process. Then, Elgamal decryption process is used to retrieve the original data and secure the E-Commerce transactions in efficiently. Based on the experiment, we have plotted the performance metrics such as MSE, PSNR and SSIM on the work and entropy of the optimal image is also calculated with respect to the sample image. Thereby, a high level performance metrics is obtained in our proposed work.