We investigate a relay network where the source and destination select one relay out of a group of untrusted relay nodes to establish a reliable and confidential connection. We assume there is no direct link between them, and the users have to employ an untrusted relay while simultaneously protecting the confidential data from it. We study joint transmit design and node selection strategies for both one-way relaying with the help of cooperative jamming from the destination, and two-way relaying. We first derive optimal algorithms through numerical methods for secrecy rate maximization, and then we propose closed-form suboptimal solutions with reduced complexity. Simulation results show that unlike the conventional relay channels, when untrusted relays are used, one-way relaying with cooperative jamming is more efficient than the two-way relaying scheme in terms of secrecy rate.