Physical layer secret key generation is a promising candidate to achieve one-time-pad encryption approach for the wireless communication system. However, in a static environment, the secret key rate is low due to the lack of channel time-variation. To solve this problem, this paper proposes a novel secret key generation scheme assisted by an intelligent reflecting surface with discrete phase shifts. In the scheme, legitimate nodes construct the dynamic time-varying channel by rapidly and randomly switching the phase of IRS elements.