A method for authenticating an entity, the method comprising: an operation 1, sending (Operation 1), by an entity A, an authentication request message to an entity B, wherein the authentication request message comprises a result SN1 of an XOR operation on a result of processing under a first predefined rule on data N1 generated locally by the entity A, and a PSK which is a key shared by the entity A and the entity B; an operation 2, receiving (Operation 2), by the entity B, the authentication request message sent by the entity A, performing an XOR operation on the SN1 in the authentication request message, and the PSK, then processing them under a second predefined rule, further processing them under a third predefined rule, then performing a further XOR operation on a result of the processing under the third predefined rule, and the PSK processed under the third predefined rule and further processed under a fourth predefined rule to obtain SON1, and sending the SON1 to the entity A in an authentication response message, wherein the second predefined rule is a reversed rule of the first predefined rule; and an operation 3, receiving (Operation 3), by the entity A, the authentication response message sent by the entity B, performing an XOR operation on the SON1 in the authentication response message, and the PSK processed under the third predefined rule and further processed under the fourth predefined rule, comparing a result of the XOR operation with the N1 processed under the third predefined rule, and determining from a result of the comparison whether the entity B is legal; wherein the first predefined rule is "+O n ", wherein SN1=(N1+O n) ⊕ PSK; the second predefined rule is "-O n ", wherein N1 B =SN1 ⊕ PSK-O n, wherein N1 B represents a result of performing by the entity B the XOR operation on the SN1 in the authentication request message, and the PSK, and then processing them under the second predefined rule; the third predefined rule is bit-wise leftward or rightward cyclic shifting by n bits, wherein the value of n is the number of bits which are "1" in the N1 B; and the fourth predefined rule is "+O n ", wherein SON1=(PSK'+O n) ⊕N1 B ', wherein N1 B ' represents the N1 B processed under the third predefined rule, and PSK' represents the PSK processed under the third predefined rule; and wherein O n represents a constant, and the symbol " ⊕ " represents a bit-wise XOR operation. an operation 1, sending (Operation 1), by an entity A, an authentication request message to an entity B, wherein the authentication request message comprises a result SN1 of an XOR operation on a result of processing under a first predefined rule on data N1 generated locally by the entity A, and a PSK which is a key shared by the entity A and the entity B; an operation 2, receiving (Operation 2), by the entity B, the authentication request message sent by the entity A, performing an XOR operation on the SN1 in the authentication request message, and the PSK, then processing them under a second predefined rule, further processing them under a third predefined rule, then performing a further XOR operation on a result of the processing under the third predefined rule, and the PSK processed under the third predefined rule and further processed under a fourth predefined rule to obtain SON1, and sending the SON1 to the entity A in an authentication response message, wherein the second predefined rule is a reversed rule of the first predefined rule; and an operation 3, receiving (Operation 3), by the entity A, the authentication response message sent by the entity B, performing an XOR operation on the SON1 in the authentication response message, and the PSK processed under the third predefined rule and further processed under the fourth predefined rule, comparing a result of the XOR operation with the N1 processed under the third predefined rule, and determining from a result of the comparison whether the entity B is legal; wherein the first predefined rule is "+O n ", wherein SN1=(N1+O n) ⊕ PSK; the second predefined rule is "-O n ", wherein N1 B =SN1 ⊕ PSK-O n, wherein N1 B represents a result of performing by the entity B the XOR operation on the SN1 in the authentication request message, and the PSK, and then processing them under the second predefined rule; the third predefined rule is bit-wise leftward or rightward cyclic shifting by n bits, wherein the value of n is the number of bits which are "1" in the N1 B; and the fourth predefined rule is "+O n ", wherein SON1=(PSK'+O n) ⊕N1 B ', wherein N1 B ' represents the N1 B processed under the third predefined rule, and PSK' represents the PSK processed under the third predefined rule; and wherein O n represents a constant, and the symbol " ⊕ " represents a bit-wise XOR operation.