In this paper, we study on how to guarantee physical layer security of cognitive radio, which can sense the environment and revise its communication parameters to dynamically access white spectrum with no interfering incumbent users. We convert the cognitive radio system to a directed graph, which contains a set of secondary users and a set of edges. We also assume that there is a time slotted Cognitive radio networks with several licensed orthogonal channels, and the usage pattern of primary users on a particular channel which is available for secondary user. Next, in order to guarantee high level security of physical layer in cognitive radio network, the cooperative communication mechanism is utilized, in which the graph nodes with good condition or better performances are reserved. Finally simulation results show that our proposed method can effectively enhance the security of physical layer in the cognitive radio networks.