  Key generation is a promising technique to establish symmetric keys between
resource-constrained legitimate users. However, key generation suffers from low
secret key rate (SKR) in harsh environments where channel randomness is
limited. To address the problem, reconfigurable intelligent surfaces (RISs) are
introduced to reshape the channels by controlling massive reflecting elements,
which can provide more channel diversity. In this paper, we design a channel
probing protocol to fully extract the randomness from the cascaded channel,
i.e., the channel through reflecting elements. We derive the analytical
expressions of SKR and design a water-filling algorithm based on the
Karush-Kuhn-Tucker (KKT) conditions to find the upper bound. To find the
optimal precoding and phase shift matrices, we propose an algorithm based on
the Grassmann manifold optimization methods. The system is evaluated in terms
of SKR, bit disagreement rate (BDR) and randomness. Simulation results show
that our protocols significantly improve the SKR as compared to existing
protocol.
