  Joint resource allocation involving optimization of subcarrier allocation,
subcarrier pairing (SCP), and power allocation in a cooperative secure
orthogonal frequency division multiple access (OFDMA) communication system with
untrusted users is considered. Both amplify and forward (AF), and decode and
forward (DF) modes of operations are considered with individual power budget
constraints for source and relay. After finding optimal subcarrier allocation
for an AF relayed system, we prove the joint power allocation as a generalized
convex problem, and solve it optimally. Compared to the conventional channel
gain matching view, the optimal SCP is emphasized as a novel concept of channel
gain tailoring. We prove that the optimal SCP pairs subcarriers such that the
variance among the effective channel gains is minimized. For a DF relayed
system, we show that depending on the power budgets of source and relay, SCP
can either be in a subordinate role where it improves the energy efficiency, or
in a main role where it improves the spectral efficiency of the system. In an
AF relayed system we confirm that SCP plays a crucial role, and improves the
spectral efficiency of the system. The channel gain tailoring property of SCP,
various roles of SCP in improving the spectral and the energy efficiency of a
cooperative communication system are validated with the help of simulation
results.
