The application provides a key negotiation method based on a
polar code and an electronic device, wherein the method is applied to a key encoding end, and the method comprises the following steps: generating a
random sequence and a negotiation key; encoding the
random sequence based on a preset
cyclic redundancy check generation rule and a
polar code encoding algorithm to obtain a first
code word; performing an
exclusive or operation on the negotiation key and the first
code word to generate first information; and sending the first information to a key decoding end, so that the key decoding end
decodes the first information to obtain a target key consistent with the negotiation key. The key negotiation method based on the
polar code and the electronic device can effectively improve the decoding accuracy, and improve the consistency and overall reliability of the key negotiation.