The Software-defined Networking (SDN) system plays a crucial role in efficiently overseeing the Internet network by segregating the control and data planes. In the SDN, the controller manages and determines the policy in sending data and setting the SDN switches. Despite the significant advantages, the SDN network has security challenges. DDoS attacks are the main challenge in SDN networks. DDoS attacks primarily target the SDN controller to disrupt network performance. Intrusion detection systems in SDN networks need confidential methods for message exchange and coordination of controllers so that they can exchange the blacklist of attacking addresses with each other. In this manuscript, we introduce an approach utilizing 1D CNN and LSTM networks for detecting attacks in the SDN network, incorporating blacklist information hidden in images. In the first stage, game theory and deep learning based on GAN are used to increase attack detection accuracy in each SDN controller to balance the data set. In the second stage, each controller uses 1D CNN to extract the primary features, and the Siberian tiger optimization (STO) algorithm is applied to enhance the efficiency of this deep learning network. In the third step, the STO algorithm selects the optimal features. Finally, the LSTM network classifies traffic by receiving the selected features. SDN controllers use image encryption to increase privacy and security for exchanging and sharing blacklists. The tests performed in Python and on datasets UNSW-NB15, CIC-IDS2017, and NSL-KDD are 99.49%, 99.86%, and 99.91%. The proposed method GAN-CL-STO demonstrates higher accuracy in detecting network attacks compared to the CNN-LSTM, HODNN+CRF, 1D CNN, PSO-1D CNN, and 1D CNN+BiLSTM methods. The suggested approach for identifying attacks in SDN is more accurate than WOA, HHO, and COA feature selection methods.