CitationXu C, Zeng P, Liang W, et al. Secure resource allocation for green and cognitive device-to-device communication. Sci China Inf Sci, 2018, 61(2): 029305, doi: 10.1007 Dear editor, Spectrum efficiency, energy efficiency and communication security are the most significant concerns in the 5G era [1]. Cognitive radio which employs dynamic spectrum sharing, energy harvesting which scavenges energy from ambient sources, and physical layer security which exploits the time varying wireless channels are three promising techniques to enhance spectrum efficiency, energy efficiency and communication security [2,3]. Although energy harvesting cognitive radio networks [4,5] and physical layer security [6,7] have been widely studied in recent years, very few existing work comprehensively address the above three concerns. Thus, cognitive, green and secure communication still remains an open research topic, which motivates this work.In this letter, we study the cognitive, green and secure device to device (D2D) communication underlaying a small cell network. To be specific, a pair of cognitive devices without constant energy supplies first harvest energy from the RF signals of a small cell base station (SCBS), and then communicate with each other in the cellular channel currently with a cellular user (CU). Thus, the transmit powers of cognitive devices are subject to both the interference power constraint from CU and the energy causality constraint imposed by energy harvesting and processing cost. However, due to the openness of wireless communication, an active eavesdropper can overhear the confidential messages in the cellular channel. Thus, to guarantee the communication security, we study the secrecy rate maximization problem to realize optimal secure resource allocation.System model. A pair of cognitive devices communicate with each other underlaying a small cell network, in which a SCBS consistently serves a CU in the cellular channel. The cognitive D2D transmitter (CDT) transmits confidential messages to the cognitive D2D receiver (CDR) in the same cellular channel which is also wiretapped by an active eavesdropper (EAV). The channel power gains from SCBS to CDT, CDR and EAV are denoted as g t , g r and g e , respectively. Similarly, the channel power gains from CDT to CU, CDR and EAV are denoted as h c , h r and h e , respectively.Both CDT and CDR are battery-free devices, but can harvest green energy from the RF signals of SCBS. The cognitive devices with singleantenna work in the half-duplex mode and operate in the harvest-then-transmit fashion in each frame T . In the first phase with duration τ T , both CDT and CDR harvest energy from SCBS, where 0 τ 1 is the harvesting ratio. The harvested energy of CDT is given by ξP s g t τ T , where P s is * Corresponding author (email: yhb@sia.cn) The authors declare that they have no conflict of interest.