This paper concerns maximizing the minimum achievable secrecy rate of a two-way relay network in the presence of an eavesdropper, in which two nodes aim to exchange messages in two hops, using a multi-antenna relay. Throughout the first hop, the two nodes simultaneously transmit their messages to the relay. In the second hop, the relay broadcasts a combination of the received information to the users such that the transmitted signal lies in the null space of the eavesdropper’s channel; this is called null space beamforming (NSBF). The best NSBF matrix for maximizing the minimum achievable secrecy rate is studied, showing that the problem is not convex in general. To address this issue, the problem is divided into three sub-problems: a close-to-optimal solution is derived by using the semi-definite relaxation (SDR) technique. Simulation results demonstrate the superiority of the proposed method w.r.t. the most well-known method addressed in the literature.