A system for time synchronization, comprising an electronic device and a server, wherein: the electronic device is configured to: generate a time bound short lived key; and transmit a packet with a first timestamp to the server, wherein the first timestamp is used to indicate a first time T1 when the packet is sent and wherein the packet contains the time bound short lived key; the server is configured to: analyze the packet based on the time bound short lived key contained in the packet to authenticate the electronic device and to obtain the first timestamp; and transmit, when the authentication is successful, a response packet to the electronic device to achieve the time synchronization, wherein the response packet contains a second timestamp and a third timestamp, the second timestamp is used to indicate a second time T2 when the server receives the packet from the electronic device and the third timestamp is used to indicate a third time T3 when the server sends the response message, wherein the electronic device is further configured to: receive the response message sent from the server and record a fourth time T4 when the electronic device receives the response message, and obtain a time offset θ between the electronic device and the server based upon a function θ=((T2-T1)+(T3-T4))/2; and perform time synchronization based on the time offset Θ between the electronic device and the server; wherein the time bound short lived key is generated by utilizing a Password-Based Key Derivation Function, PBKDF, and the time bound short lived key is generated by hashing a password and a key, wherein the key comprises an originating time stamp corresponding to the first timestamp T1 and a value to indicate a number of hash iterations performed to generate the time bound short lived key. the electronic device is configured to: generate a time bound short lived key; and transmit a packet with a first timestamp to the server, wherein the first timestamp is used to indicate a first time T1 when the packet is sent and wherein the packet contains the time bound short lived key; generate a time bound short lived key; and transmit a packet with a first timestamp to the server, wherein the first timestamp is used to indicate a first time T1 when the packet is sent and wherein the packet contains the time bound short lived key; the server is configured to: analyze the packet based on the time bound short lived key contained in the packet to authenticate the electronic device and to obtain the first timestamp; and transmit, when the authentication is successful, a response packet to the electronic device to achieve the time synchronization, wherein the response packet contains a second timestamp and a third timestamp, the second timestamp is used to indicate a second time T2 when the server receives the packet from the electronic device and the third timestamp is used to indicate a third time T3 when the server sends the response message, wherein the electronic device is further configured to: receive the response message sent from the server and record a fourth time T4 when the electronic device receives the response message, and obtain a time offset θ between the electronic device and the server based upon a function θ=((T2-T1)+(T3-T4))/2; and perform time synchronization based on the time offset Θ between the electronic device and the server; analyze the packet based on the time bound short lived key contained in the packet to authenticate the electronic device and to obtain the first timestamp; and transmit, when the authentication is successful, a response packet to the electronic device to achieve the time synchronization, wherein the response packet contains a second timestamp and a third timestamp, the second timestamp is used to indicate a second time T2 when the server receives the packet from the electronic device and the third timestamp is used to indicate a third time T3 when the server sends the response message, wherein the electronic device is further configured to: receive the response message sent from the server and record a fourth time T4 when the electronic device receives the response message, and obtain a time offset θ between the electronic device and the server based upon a function θ=((T2-T1)+(T3-T4))/2; and wherein the time bound short lived key is generated by utilizing a Password-Based Key Derivation Function, PBKDF, and the time bound short lived key is generated by hashing a password and a key, wherein the key comprises an originating time stamp corresponding to the first timestamp T1 and a value to indicate a number of hash iterations performed to generate the time bound short lived key.