Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a cloud-based ultra-lightweight radio frequency identification tag ownership transfer method so as to improve the initiative of tags and improve the working efficiency and safety of tag ownership transfer.
The technical scheme of the invention is as follows: the reader stores the tag information in a cloud database, and the tag generates a random number for encrypting the pseudo-identity of the tag in the authentication stage and then sends the random number to the reader; the reader sends the received hash value of the label pseudo-identity to the cloud, the cloud searches the stored label information by taking the hash value as an index, if the label information cannot be searched, error information is returned, and if corresponding information is searched, the corresponding information is sent to the reader
(1) Data initialization:
after the tag identity ID, the tag information info and the tag secret key K are cascaded, the secret key K of the reader R is usedREncrypting and storing the tag T pseudo identity TID in a cloud database in the form of H (TID) as an index, and storing a communication secret key K between the reader and the cloudRCThe tag pseudo identity TID is stored in a cloud database C, wherein H (·) represents hash operation;
the label ID, the label pseudo-identity TID, the label secret key K, the reader identity RID and the random number generator seed K1Storing in a tag;
sharing a secret key K with the reader identity RID, the new label owner identity RID', the reader and the new label ownerRR'Communication secret key K between reader and cloudRCStoring in a reader;
sharing the reader identity RID, the new tag owner identity RID' and the reader and the new tag owner by a secret key KRR'Stored in the new tag owner;
(2) the reader generates a first random number N of the reader
1And reader first message
Sending to the tag, after the tag determines its validity, designing a PRNG random number generator to generate a first random number PRNG (k) of the tag
1) Generating the first message T of label
1And tag second message T
2Returning to the reader, wherein:
{. represents a set of information,
representing exclusive-or processing, | | | represents message concatenation, cro (·) represents performing confusion operation on information, per (·) represents performing permutation operation on the information, and PRNG (·) represents performing nonlinear random number generation processing on seed data;
(3) the reader obtains the label pseudo identity TID through two label messages, calculates the Hash value H (TID) thereof, and generates a second random number N of the reader
2Then, a second message of the reader is generated
Sending the information to a cloud database, and generating a cloud message by the cloud database
Returned to the reader where
The representative uses a shared secret key between the reader and the cloud to carry out encryption operation on the information;
(4) the reader obtains the K, the ID and the info of the tag through the cloud message, starts an ownership request stage, and generates a third random number N of the reader
3And a communication secret key S, and four messages R of the reader are generated through calculation
3 R
4 R
5 R
6Sending to the tag, wherein: third message of reader
Reader fourth message
Reader fifth message
Reader sixth message
(5) R of tag passing reader
3 R
4 R
5 R
6The four messages obtain a third random number N of the reader
3PRNG random number generator generates a tag second random number PRNG (k) and a tag owner identity RID
2) Then, a third message of label is generated
And tag fourth message
Sending the ownership transfer request to the reader, and completing the ownership transfer request phase;
(6) the reader generates a fourth random number N of the reader
4According to a fourth random number N
4Generating a reader seventh message
Sending the information to the new label owner, generating a message verification code MAC according to a seventh message of the reader after the new label owner confirms the validity of the new label owner, and then generating verification information of the reader
Feed reader, reader off-field, wherein
Encrypting the information by using a shared secret key of the reader and the owner of the new tag on behalf of the reader;
(7) the new tag owner generates a first random number n of new tag owners
1Then, the first message of the new label owner is generated
Sending to the tag, the tag confirming the validity of the new tag owner, designing a PRNG random number generator to generate a third machine number PRNG (k) of the tag
3) Then, the fifth message of the label is generated
And tag sixth message
Sending to the new tag owner;
(8) new tag owner according to T
3And T
4The two label messages confirm the validity of the label and generate a second random number n of the new label owner
2After new label secret key K 'and new label pseudo identity TID', three new label owner messages r are generated
2 r
3r
4Sending to the tag, updating the stored information, designing a PRNG random number generator to generate a fourth random number PRNG (k) of the tag
4) Then, two label messages T are generated
7 T
8And feeding back to the new tag owner, completing ownership transfer, wherein: new tag owner second message
New tag owner third message
New tag owner fourth message
Tag seventh message
Tag eighth message
Compared with the prior art, the invention has the following advantages:
first, the present invention enables ultra lightweight tags to also have the capability to generate random numbers by designing a PRNG random number generator to generate the tag random numbers.
Secondly, the cloud database is adopted to replace the traditional database, so that the authentication is more convenient, the consumption of the storage space of the reader is greatly reduced, and the utilization rate and the working efficiency of the reader are improved.
Thirdly, the invention encrypts and transmits the information in all the sentences, ensures that all the information has good confidentiality, and ensures that no useful information can be obtained even if an adversary intercepts and captures the information, thereby ensuring the safety of the information.
Fourthly, the operation methods used in the invention are all ultra-light operation methods, so that the operation burden of the tag and the reader is greatly reduced, and the operation efficiency is greatly improved.
Detailed Description
The present invention will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, the implementation steps of the invention are as follows:
step 1, data initialization.
The purpose of data initialization is to pre-store all required information in a designated device, and the specific implementation steps are as follows:
1a) setting a tag key K and a reader key KRSetting a communication secret key K between the reader and the cloud databaseRC;
1b) Storing the key set in 1a) and the related information of the tag and the reader:
concatenating the ID with the tag identity ID, the tag information info and the tag key K, and using the reader key KREncrypting the operation result and storing the operation result in a cloud database;
carrying out hash function processing on the tag pseudo identity TID, and storing a processed result H (TID) as an index in a cloud database C;
communication secret key K between reader and cloud databaseRCStoring the label pseudo identity TID in a cloud database, wherein H (·) represents hash operation;
the label identity ID, the label pseudo-identity TID, the label secret key K, the reader identity RID and the random number generator seed K1Stored in tag T;
the reader identity RID, the new tag owner identity RID' and a communication secret key K between the reader and the cloud databaseRCStored in the reader R;
the reader identity RID, the new tag owner identity RID 'are stored in the new tag owner R'.
And 2, the reader sends an authentication request to the tag.
(2a) The reader generates a first random number of the reader with 32bits by using a random number generation method ANSI X9.17:
(2a1) selecting current time and date DTiAs input for the random number generation method ANSI X9.17, seed V was chosen at williDefining a 56-bits encryption key s by user;
(2a2) the whole process of the encryption operation comprises three times of triple DES encryption, and the time and date DT is firstly encryptediAnd seed ViPerforming XOR operation, and performing triple DES encryption operation on the XOR operation result and the encryption key s to obtain an output RiTime and date DTiAnd RiAfter XOR operation, triple DES encryption operation is performed with the encryption key s to obtain a new Vi+1Namely the random number which is finally generated;
(2b) the identity information and the first random number of the reader are subjected to cro confusion operation,
referring to fig. 2, the processing steps of the cro aliasing operation are as follows:
(2b1) inputting two 32-bits bit strings of identity information and a first random number of a reader;
(2b2) taking 16 bits at odd positions such as 1, 3 and 5 of the identity information and 16 bits at even positions such as 2, 4 and 6 of the first random number of the reader, and combining the taken bits into a new 32-bit string, namely a cro confusion operation result, wherein the selected bits are placed according to the positions in the original bit string;
(2c) the reader will confuse the operationThe result of (1) and the first random number N of the reader
1The first message R of the reader is obtained by cascading
1R is to be
1Is sent to a tag, wherein
{. represents a set of information,
indicating exclusive or processing and | | l indicating message concatenation.
And 3, responding to the request of the reader by the tag.
(3a) The tag receives a first message R of the reader1Then, directly reading the first random number N of the reader1Performing the same obfuscation operation as that in step (2b) on all the identities stored in the mobile terminal, and combining the obfuscation operation result with the identity R1And (3) carrying out comparison:
if the two results are consistent, authenticating the first message R of the reader1For a legitimate message, performing (3 b);
if the two results are not consistent, the tag considers the first message R of the reader1Terminating the communication for an illegal message;
(3b) tag uses initial seed k1Generating a tag first random number PRNG (k)1):
Referring to fig. 4, the PRNG random number generator generates a random number as follows:
(3b1) initial seed k1Sequentially inputting the data into a linear feedback shift register from 1 to 32bits, and using a primitive polynomial y with the degree of 32 as x32+x18+x17+ x +1 pairs of initial seeds k1Iterative processing is carried out, a new digit is generated each time, the new digits are sequentially input into the linear feedback shift register, and the last digit is deleted to obtain ki+1;
(3b2) Inputting 32-bit digits in the current linear feedback shift register into a Boolean function filter for nonlinear processing to obtain a digit;
(3b3) continuously performing the steps (3b1) and (3b2) for 32 times to obtain 32-bit output, namely the final output result of the PRNG random number generator, wherein the final output result is the random number generated by the label;
(3c) the tag generates two tag messages to the reader:
(3c1) the tag will have a reader identity RID and its own first random number PRNG (k)1) After the XOR operation, per replacement operation is carried out with the reader identity RID,
referring to fig. 3, the per permutation operation includes the following specific steps: setting two equal-length input bit strings as x and y, arranging the position ordinal number of 1 in x from small to large, then arranging the position ordinal number of 0 from large to small to obtain a new position ordinal number arrangement table, then rearranging the bit in y according to the new position ordinal number arrangement table to generate a label first message
(3c2) First random number N of tag to reader
1And its own first random number PRNG (k)
1) Performing XOR operation on the pseudo identity TID to generate a second label message
(3c3) The label sends its first message T1And a second message T2And sending the data to a reader.
And 4, the reader sends a data acquisition request to the cloud database.
(4a) The reader receives a first message T of the label1Inverse per permutation operation is performed to obtain a first random number PRNG (k) of the tag1) Then using the self-identity RID and the first random number PRNG (k) of the label1) First message T with tag1Performing exclusive or operation to obtain a label pseudo identity TID;
(4b) the reader generates a second random number N of the reader using the same method as in the step (2a)2And simultaneously carrying out hash operation on the label pseudo identity TID to obtain a hash value H (TID):
(4b1) filling 128 bits of label pseudo identity information, filling 1 in the 129 th bit, and then filling 318 bits of 0 to ensure that the length of the whole number series is 512, and ensuring that the result of the whole number series after modulo 512 processing is 448;
(4b2) randomly selecting 64 bits, representing the length of the message before filling in a little-endian mode, namely storing the highest 64 bits in the highest address and storing the last 64 bits in the lowest address, and sequentially dividing the 512-bit message into 16 32-bit strings;
(4b3) initializing a program internal module, storing an intermediate result and a final hash result by using a 128-bit long buffer, and expressing the intermediate result and the final hash result by using the buffer as 4 32-bit long registers (A, B, C and D), wherein each register stores data in a lite-endian manner, and the initial value is A (01234567), B (89 ABCDEF), C (FEDCBA 98) and D (76543210);
(4b4) by compression function HMD5Sequentially compressing 16 32bit strings to obtain an operation result, namely a hash value H (TID);
(4c) the reader sends the second random number N to the reader2Cascading with the hash value of the label pseudo-identity, and using a communication secret key K between the reader and the cloud databaseRCThe concatenated result is encrypted in RC 4:
(4c1) setting the length of a key core part S-box to be 128, setting the length of a communication key to be 128, and initializing a byte sequence in the key core part S-box by using a key-scheduling algorithm;
(4c2) processing the key core part S-box and the communication key by using a pseudorandom sub-password generation algorithm to obtain a sub-key sequence, and performing exclusive or operation on the sub-key sequence and a plaintext to obtain an encryption result;
(4d) the reader will encrypt the result and the second random number N of the reader
2Cascading to obtain a second message of the reader
And sending to the cloud database.
And 5, the cloud database feeds back the requested information to the reader.
(5a1) The cloud database is according to the second message R of the reader2Directly reading the second random number N of the reader2Then, the second message of the reader is decrypted to obtain a second random number N of the reader2N obtained at this time2And a second random number N read directly2And (3) carrying out comparison:
if the comparison result is inconsistent, the message is tampered, the cloud database generates warning information warning, and the communication is terminated;
if the comparison result is consistent, performing the step (5a 2);
(5a2) the cloud database is searched by using the obtained index value:
if the corresponding storage unit is not searched, the cloud database end generates an error message and returns the error message to the reader, the communication is ended, and the reader believes that the tag which is communicated with the reader before is an illegal tag after receiving the error message;
if the corresponding storage unit is found, the stored label pseudo-identity TID and other stored information are used
And a second random number N of the reader
2Cascading, and then encrypting by using a symmetric communication secret key between the cloud database and the reader to obtain cloud database information
And sent to the reader.
And 6, the reader sends an ownership transfer request to the tag.
(6a) The reader compares the label pseudo identity received in the cloud database message M with the label pseudo identity received from the label end:
if the comparison result is inconsistent, the reader determines that the data of the cloud database end is invaded, tampered or damaged;
if the comparison result is consistent, the reader stores the secret information of the ID, the key K and the info of the tag, and executes the step (6 b);
(6b) the reader generates a third random number N of the reader3And a communication key S:
the reader generates a third random number N of the reader by using the same random number generation method as the steps (2a) and (4b)3
The reader carries out XOR operation on the tag key K and random numbers with the same length as the tag key K to obtain a communication secret key S;
(6c) the reader generates four reader messages and sends the four reader messages to the tag:
the reader sends the first random number of the label and the third random number N of the reader
3Performing XOR operation with the tag key K to generate a third message of the reader
The reader sends its third random number N
3And carrying out XOR with the tag identity, and then carrying out per replacement operation on the XOR operation result and the tag identity to obtain a fourth message of the reader
The reader carries out XOR operation on the label key K and the communication key S, and carries out XOR operation on the result of the XOR operation and a third random number N of the reader
3Per permutation operation is carried out to obtain the fifth message of the reader
The reader carries out XOR operation on the identity of the reader and the identity of the owner of the new label, and per replacement operation is carried out on the operation result and the communication key S to obtain a sixth message of the reader
The reader sends a third message R of the reader3A fourth message R4A fifth message R5And a sixth message R6And sending to the tag.
And 7, after authenticating the reader, the tag stores the updating information and returns confirmation information.
(7a) The tag authenticates the reader, and the tag sends the first random number of the tag, a tag key K and a third message R of the reader3Performing XOR operation to obtain a third random number N of the reader3Using the third random number N of the reader3Performing XOR operation with the identity of the reader, performing per permutation operation on the XOR operation result and the identity of the reader, and performing the permutation operation result with the fourth message R of the reader4And (3) carrying out comparison:
if the comparison result is consistent, the label determines that the sender is legal, and the step (7b) is continued;
if the comparison result is not consistent, the label determines that the sender is illegal and terminates the communication;
(7b) the label stores the updated information:
the third random number N of the reader is used by the tag3To reader fifth message R5Carrying out inverse per replacement operation, and carrying out exclusive or operation on a replacement operation result and the tag key K to obtain and store a communication key S;
the tag uses the communication key S to send a sixth message R to the reader6Carrying out inverse per displacement operation, and carrying out exclusive OR on the displacement operation result and the reader identity to obtain and store the identity RID' of the new tag owner;
(7c) the tag returns confirmation information to the reader:
(7c1) the label uses the same random number generation method as in step (3b), using seed k2Generating a tag second random number PRNG (k)2);
(7c2) The tag sends two tag messages to the reader:
the tag sends its own second random number PRNG (k)
2) A communication key S and a third random number N of the reader
3Performing XOR operation to generate a third label message
The tag respectively compares the received new tag owner identity RID' and the communication key S with a tag second random number PRNG (k)
2) Performing XOR operation, and performing XOR operation on the two resultsGenerating a fourth message of the label by the line per permutation operation
Tag will tag the third message T3And a tag authentication message T4And sending the data to a reader.
And 8, the reader confirms that the label successfully receives the updating information.
The reader receives the third message T of the label3Then, the third random number N is added to the communication secret key S and the reader3Performing XOR operation to obtain a second random number PRNG (k) of the tag2) The new tag owner identity RID' and the communication key S are then respectively associated with the tag second random number PRNG (k)2) Performing XOR operation, and finally comparing the result with the tag verification message T4And (3) carrying out comparison:
if the comparison result is consistent, it indicates that the tag has correctly obtained the identity of the new tag owner and the communication key of the new tag owner, and the reader starts to perform step 9;
if the comparison result is inconsistent, the reader will re-transmit and verify the relevant information if the tag does not receive the correct information.
And 9, the reader confirms that the new label owner receives the label information.
(9a) The reader sends the tag information to the new tag owner:
the reader generates a fourth random number N of the reader by using the same random number generation method as that in the step (2a), the step (4b) and the step (6b)4;
The reader sends the ID RID, the tag pseudo-ID TID, the tag ID, the tag information info, the communication key S and the fourth random number N of the reader4After the cascade connection, the communication secret key K between the reader and the new label owner is usedRR'Performing encryption operation on the cascading result by the same encryption method as the step (4c) to generate a seventh message of the reader
And sending the seventh message to the new tag owner;
(9b) the new label owner directly reads the fourth random number N of the reader4And then, decrypting the seventh message of the reader, and comparing the reader identity obtained after decryption with the stored reader identity:
if the comparison result is not consistent, the owner of the new label determines that the information sender is illegal, and the communication is terminated;
if the comparison result is consistent, the new label owner determines that the information sender is legal, stores the label information contained in the information and carries out the step (9 c);
(9c) the new label owner calculates the received secret information by using the same Hash operation method as the Hash operation method in the step (4b) to obtain a message authentication code MAC, and the message authentication code MAC and the received fourth random number N of the reader
4After the cascade connection, the communication secret key K between the reader and the new label owner is used
RR'Encrypting the cascade result in the same encryption mode as the step (4c) to obtain the reader verification message
And sending the verification message to the reader;
(9d) the reader receives the reader verification message r1Afterwards, the corresponding information contained in the MAC is verified:
if the received MAC is incorrect, the reader determines that the new label owner does not correctly receive the label information, and the reader retransmits the label information;
if the received MAC is correct, the reader determines that the new label owner has correctly received the corresponding information of the label, and the reader leaves the field.
Step 10, ownership transfer.
The new tag owner generates a first random number n of the new tag owner using the same method as the random number generation method in the step (2a), the step (4b), the step (6b) and the step (8a)
1And the new label owner is given a first random number n
1With self identityXOR processing, namely performing cro confusion operation on the XOR operation result and the identity of the user and then performing cro confusion operation on the XOR operation result and the identity of the user and the first random number n of the new label owner
1Cascading to obtain a first message of a new label owner
And sending the owner first message to the tag;
step 11, the new tag owner verifies the tag.
(11a) The label receives a first message r of a new label owner1Then, directly reading the first random number n of the new tag owner1After cre confusion operation is carried out on the identity of the stored new label owner and the identity of the new label owner, the identity of the new label owner and the received first message r of the new label owner are carried out1And (3) carrying out comparison:
if the comparison result is consistent, the label believes that the sender is legal, and meanwhile, the step (11b) is carried out;
if the comparison result is not consistent, the label considers that the message sender is illegal, and the label terminates the communication;
(11b) the tag sends two messages to the new tag owner:
(11b1) the tag generates a third random number PRNG (k) of the tag using the same random number generation method as in steps (3b) and (7c1)3);
(11b2) The tag compares the new tag owner identity with a third random number PRNG (k) of the tag
3) After XOR operation, per replacement operation is carried out on the identity of the new label owner to generate a fifth label message
(11b3) The label carries out XOR operation on the self identity, the third random number of the label and the identity of the owner of the new label to generate a sixth message of the label
(11b4) The label sends a third message T of the label3And its own fourth message T4Sending to the new tag owner;
(11c) after the new label owner receives the fifth and sixth messages of the label, per replacement operation is carried out on the fifth message of the label to obtain a third random number PRNG (k) of the label3) The new tag owner will receive the third random number PRNG (k) of the tag3) Self-identity RID' and tag fourth message T4Performing exclusive or operation to obtain a tag pseudo identity TID, and comparing the TID with a stored tag pseudo identity:
if the comparison result is inconsistent, the new label owner determines that the label is illegal, and the new label owner reports an error to the reader and terminates the communication with the label;
if the comparison result is consistent, the new label owner determines that the label is legal, and stores the third random number PRNG (k) of the label3) Then, step 12 is performed;
and step 12, updating the information of the label.
(12a) The new label owner generates a second random number n of the new label owner by using the same random number generation method as the random number generation method in the step (2a), the step (4b), the step (6b), the step (8a) and the step 92;
(12b) The new tag owner generates tag information that the tag needs to be updated:
(12b1) randomly selecting a random number with the same length as the communication key by the owner of the new tag, and carrying out XOR operation on the random number and the communication key to obtain a new tag key K';
(12b2) randomly selecting a random number with the same length as the pseudo-identity of the new label by the owner of the new label, and carrying out XOR operation on the random number and the pseudo-identity of the new label to obtain a pseudo-identity TID';
(12c) the new tag owner sends three new tag owner messages to the tag:
the new tag owner will tag a third random number PRNG (k)
3) A new tag key K' and a second random number n of new tag owners
2Carrying out XOR operation to obtain a second message of the new label owner
The new label owner performs XOR on the new label key K 'and the communication key S, and then performs XOR on the new label key K' and the communication key SSecond random number n of tag owners
2Performing per replacement operation to generate third message of new label owner
After the new label owner carries out XOR operation on the label pseudo-identity and the new label pseudo-identity, per replacement operation is carried out on the new label owner and the new communication secret key K' to generate a fourth message of the new label owner
The new label owner sends own second message, third message and fourth message to the label;
(12d) tag updating information and deleting reader information
(12d1) After receiving the information, the label sends a second message of a new label owner to the PRNG (k)2) Carrying out XOR operation to obtain a second random number n of the new label owner2Then using a second random number n of new tag owners2Carrying out inverse per substitution operation on the third message of the new tag owner, and carrying out XOR operation on the result and the communication secret key S to obtain and store a new communication secret key K';
(12d2) the tag uses the new communication secret key K 'to perform reverse permutation operation on the fourth message of the new tag owner, and then performs exclusive or operation on the permutation operation result and the self pseudo identity to obtain and store a new tag pseudo identity TID';
(12d3) and deleting the original label pseudo identity TID and the communication secret key K by the label.
And step 13, the label sends update completion confirmation information to the new label owner.
(13a) The tag uses the same random number generation method as in step (3b), step (7c1), step (11b1) in k4Generating a fourth random number PRNG (k) of the tag for the seed4);
(13b) The tag generates two tag messages to the new tag owner:
the tag will tag a fourth random number PRNG (k)
4) A new tag key K' and a second random number n of the new tag owner
2Performing XOR operation to obtain the seventh message of the label
The label respectively compares the new label pseudo identity TID 'with a new label key K' and a third random number PRNG (K) of the label
3) Performing XOR operation, and per replacement operation on the two XOR operation results to obtain the eighth message of the label
The label sends its fifth message T5And a sixth message T6To the new tag owner.
And step 14, confirming the updating condition of the label information by the new label owner.
(14a) The new label owner will label the seventh message T7A new tag key K' and a second random number n of new tag owners2Performing XOR operation to obtain the fourth random number PRNG (k) of the tag4);
(14b) The new tag owner will tag the fourth random number PRNG (k)4) Performing exclusive-or operation with the new tag pseudo-identity TID 'and the new tag key K', performing per replacement operation on the two exclusive-or operation results, and comparing the per replacement operation result with the eighth tag message:
if the comparison result is inconsistent, the new label owner determines that the label does not correctly receive the updating information, and the new label owner sends an updating request to the label again;
if the comparison result is consistent, the new label owner determines that the label correctly receives the updating information and has been updated successfully, the ownership transfer is successful, and the communication is finished.
The foregoing description is only an example of the present invention and is not intended to limit the invention, so that it will be apparent to those skilled in the art that various changes and modifications in form and detail may be made therein without departing from the spirit and scope of the invention.