Finite-length codes are learned for the Gaussian wiretap channel in an end-to-end manner assuming that the communication parties are equipped with deep neural networks (DNNs), and communicate through binary phase-shift keying (BPSK) modulation scheme. The goal is to find codes via DNNs which allow a pair of transmitter and receiver to communicate reliably and securely in the presence of an adversary aiming at decoding the secret messages. Following the information-theoretic secrecy principles, the security is evaluated in terms of mutual information utilizing a deep learning tool called MINE (mutual information neural estimation). System performance is evaluated for different DNN architectures, designed based on the existing secure coding schemes, at the transmitter. Numerical results demonstrate that the legitimate parties can indeed establish a secure transmission in this setting as the learned codes achieve points on almost the boundary of the equivocation region.