Research Article

An Identity Authentication Scheme Based on SM2 Algorithm in UAV Communication Network

Algorithm 1

Core algorithm of the UAV side.
Time_2 =get_cpu_time() #The start point of the authentication time is calculated
client. send(message(IDu,Ru)) #The start point of the authentication time is calculated
IDs,Rs = client. recv(1024)#The UAV receives the IDs and Rs sent by the control station
res = check(IDu) #The drone verifies the IDs
res, content = sm2_uav.negotiation(Rs, PS, IDS, option, Ru, Ru)#Key negotiation
if not res:
     print(’error:’, content)
     return
     if option:#Generates the negotiation key, the KU
     Ru, KU, SU, U2 = content
     else:
     Ru, KU = content
     SU = None
encData=client. recv(1024)#The drone receives the ciphertext
decData = SM4. decryptSM4(KU, encData)#The drone receives the ciphertext
Time_2 =get_cpu_time() #Calculate the cutoff point of the authentication time
print(’Certification time consuming:%. 2f ms’ % ((Time_2 - Time_1) 1000))#Time used to output authentication
Command_send(decData)#The drone sends the decrypted commands to the UAV model operation in the Gazebo simulation environment