  In this paper, we introduce an intelligent reflecting surface (IRS) to
provide a programmable wireless environment for physical layer security. By
adjusting the reflecting coefficients, the IRS can change the attenuation and
scattering of the incident electromagnetic wave so that it can propagate in a
desired way toward the intended receiver. Specifically, we consider a downlink
multiple-input single-output (MISO) broadcast system where the base station
(BS) transmits independent data streams to multiple legitimate receivers and
keeps them secret from multiple eavesdroppers. By jointly optimizing the
beamformers at the BS and reflecting coefficients at the IRS, we formulate a
minimum-secrecy-rate maximization problem under various practical constraints
on the reflecting coefficients. The constraints capture the scenarios of both
continuous and discrete reflecting coefficients of the reflecting elements. Due
to the non-convexity of the formulated problem, we propose an efficient
algorithm based on the alternating optimization and the path-following
algorithm to solve it in an iterative manner. Besides, we show that the
proposed algorithm can converge to a local (global) optimum. Furthermore, we
develop two suboptimal algorithms with some forms of closed-form solutions to
reduce the computational complexity. Finally, the simulation results validate
the advantages of the introduced IRS and the effectiveness of the proposed
algorithms
