This invention discloses a
key exchange method, apparatus, and storage medium based on a modular lattice. The
key exchange method includes: Party A generating a
random number seed, obtaining a compressed public key, and sending it to Party B; Party B using the
random number seed to obtain the compressed public key; recovering data from the received compressed public key from Party A and calculating a temporary key;
processing the temporary key using a segmented
signal function to obtain a
signal value; using the
signal value to coordinate the temporary key to obtain a shared temporary key, thereby generating a
verification tag and deriving the final key; Party A recovering data from the received compressed public key from Party B, recalculating the
verification tag, and comparing them; only when a match is successful, the final key is derived using the same method. This ensures the randomness of the data and the ability to detect tampering with the data received by Party A, thus achieving higher security. This invention significantly reduces the
failure probability while improving security.