CN104104499A - Data transmission method, electronic coded lock device and control method thereof - Google Patents

Data transmission method, electronic coded lock device and control method thereof Download PDF

Info

Publication number
CN104104499A
CN104104499A CN201410364199.6A CN201410364199A CN104104499A CN 104104499 A CN104104499 A CN 104104499A CN 201410364199 A CN201410364199 A CN 201410364199A CN 104104499 A CN104104499 A CN 104104499A
Authority
CN
China
Prior art keywords
message
control module
rfid control
electromechanical lock
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410364199.6A
Other languages
Chinese (zh)
Other versions
CN104104499B (en
Inventor
刘连生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN POKA ELECTRONIC EQUIPMENT CO Ltd
Original Assignee
SHENZHEN POKA ELECTRONIC EQUIPMENT CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN POKA ELECTRONIC EQUIPMENT CO Ltd filed Critical SHENZHEN POKA ELECTRONIC EQUIPMENT CO Ltd
Priority to CN201410364199.6A priority Critical patent/CN104104499B/en
Publication of CN104104499A publication Critical patent/CN104104499A/en
Application granted granted Critical
Publication of CN104104499B publication Critical patent/CN104104499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an electronic coded lock device which comprises a RFID (Radio Frequency Identification) control module and an electromechanical lock module. The RFID control module and the electromechanical lock module respectively comprise a storage unit, a communication unit, a checking unit, a first encryption and decryption unit and a second encryption and decryption unit, wherein each storage unit is arranged to store an initial secret key and a communication secret key plaintext; each communication unit is arranged to realize mutual communication between the RFID control module and the electromechanical lock module; each first encryption and decryption unit is arranged to perform a CRC8 (Cyclic Redundancy Check 8) checking algorithm and perform DES (Data Encryption Standard) encryption algorithm for one time; each second encryption and decryption unit is arranged to perform the DES encryption algorithm for multiple times; each checking unit is arranged to check data transmitted between the RFID control module and the electromechanical lock module. The invention further discloses a data transmission method in the electronic coded lock device and a control method of the electronic coded lock device.

Description

Data transmission method, electronic coded lock device and control method thereof
Technical field
The present invention relates to electronic password lock technical field, relate in particular to a kind of data transmission method for electronic coded lock device, also relate to a kind of electronic coded lock device and control method thereof.
Background technology
At present, be disposable for transporting the packing case of banknote, pure mechanical snap is stuck, in the time opening the box, need to destroy chest, and cost compare is large, and it is cumbersome to unpack.In order to save the cost of currency logistics, and realize intellectuality, adopt pocket of electrons vanning to replace traditional packing case for currency logistics, can repeatedly use, and open locking needs authentication to realize fail safe.In pocket of electrons vanning, be provided with electronic password lock, particularly important for the transmission means of the data in electronic password lock.
CRC check is cyclic redundancy check (CRC) code (Cyclic Redundancy Check): be a kind of error check code the most frequently used in data communication field, it is characterized in that the length of information field and check field can be selected arbitrarily.CRC check can be described as simply: for example we will send some data (information field), what judge whether acceptance for fear of some interference and in the data to reading of receiving terminal is real data, at this moment we will add checking data (being CRC check code), judge that whether the data of reception are correct.At transmitting terminal, according to the k position binary code sequence that will transmit, with certain rule, (CRC check has different rules.This rule is called " generator polynomial " in Error control theory.) produce a r bit check code (CRC code) that verification is used, be attached to raw information back, form new binary code sequence number k+r position altogether, then send.At receiving terminal, test according to the rule of following between information code and CRC code while sending (with generate the rule that CRC check code is identical), verification adopts the mould double division method of computer, be that divisor and dividend (being generator polynomial) do XOR, divisor and the alignment of dividend highest order while carrying out XOR, carry out step-by-step XOR, if final data can be divided, transmission is correct; Otherwise, error of transmission.
DES is as (the American National Standard Institute of American National Standards Institute, ANSI) DEA (Data Encryption Algorithm, and (the International Organization for Standardization of International Organization for standardization DEA), ISO) DEA1, becomes two more than ten years of a worldwide standard.Although he is with the feature in past tense generation, he has withstood cryptanalysis for many years well, except the most strong possible opponent, other attack is had to good fail safe.
DES is a kind of block encryption algorithm, and he is taking 64 as grouping is to data encryption.The plaintext of 64 one group is from one end input of algorithm, and the ciphertext of 64 is exported from the other end.DES is a symmetry algorithm: what encryption and decryption were used is same algorithm (except key schedule difference).The length of key be 56 (key is typically expressed as the number of 64, but each the 8th as odd-even check, can ignore).Key can be 56 figure places arbitrarily, and can arbitrarily time, change.The suction parameter of DES algorithm has 3: Key, Data, Mode.Wherein Key is totally 64 of 8 bytes, is the working key of DES algorithm; Data is also 64 of 8 bytes, is to want data encrypted or deciphering: the working method that Mode is DES, has two kinds: encrypt or deciphering.The course of work of DES algorithm: if Mode is for encrypting, with Key, data Data is encrypted, generates the password form (64) of Data as the Output rusults of DES; If Mode is deciphering, the data Data deciphering to password form with Key, is reduced to the plain code form (64) of Data as the Output rusults of DES.
Summary of the invention
In view of this, the invention provides a kind of data transmission method, be applied to the electronic coded lock device in pocket of electrons vanning, solved the safety issue of transfer of data in electronic coded lock device.
In order to reach above goal of the invention, the present invention has adopted following technical scheme:
A kind of data transmission method, for transmitting message data between first terminal and the second terminal, comprise the step that the instruction message in described message data is encrypted, wherein, described instruction message is made up of instruction head, test serial number and director data, and length is 24 bytes; Wherein, step instruction message being encrypted specifically comprises:
Carry out at first terminal:
(a), employing communication key is expressly carried out a des encryption computing to described test serial number, acquisition communication process key;
(b), described instruction message is divided into three parts in order: front 8 bytes, in 8 bytes and rear 8 bytes;
(c), adopt described communication process key to carry out a des encryption computing to described front 8 bytes, the result obtaining again with described in 8 bytes carry out step-by-step XORs, obtain the first encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains the second encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains a MAC value;
(d), message data and a MAC value are transferred to the second terminal by first terminal;
Carry out in the second terminal:
(e), to the message data receiving, with reference to step (a), (b) and (c), calculate and obtain the 2nd MAC value;
(f), data check: contrast a MAC value and the 2nd MAC value, if identical, verification is correct; If different, check errors.
Wherein, the method also comprises step: at first terminal, described message data is carried out to CRC8 checking algorithm, so that user instruction is carried out to completeness check, obtain the first crc value and send to the second terminal; The second terminal obtains the second crc value to described message data execution CRC8 checking algorithm after receiving described message data; In the step of data check, also crc value is carried out to verification, contrast the first crc value and the second crc value, if identical, verification is correct; If different, check errors.
Wherein, described CRC8 checking algorithm is: CRC8-CCITT, X8+X7+X3+X2+1.
Wherein, in step (a), if 8 of the byte deficiencies of test serial number, right benefit 0x00 to 8 byte.
Wherein, in the time using first terminal and the second terminal first, carry out initialized step, specifically comprise: adopt initial key expressly to carry out a des encryption computing to communication key at first terminal, obtain communication key ciphertext and be sent to the second terminal; After the second terminal receives communication key ciphertext, use initial key to be decrypted and to obtain described communication key expressly and preserve described communication key ciphertext, complete initialization.
The present invention also provides a kind of electronic coded lock device, comprise RFID control module and electromechanical lock module, wherein, described RFID control module and electromechanical lock module comprise respectively memory cell, communication unit, verification unit, the first encryption/decryption element and the second encryption/decryption element; Between described RFID control module and electromechanical lock module, adopt data transmission method transmitting message data as above, wherein,
Memory cell is set to storing initial key and communication key plaintext;
Communication unit is set to realize the intercommunication of described RFID control module and electromechanical lock module;
The first encryption/decryption element is set to carry out CRC8 checking algorithm and carries out a des encryption computing;
The second encryption/decryption element is set to repeatedly des encryption algorithm;
The data that verification unit is set to transmitting between described RFID control module and electromechanical lock module are carried out verification.
Wherein, described the second ciphering unit is carried out 3 des encryption algorithms.
Wherein, memory cell in described RFID control module comprises the first storage chip and the second storage chip, wherein, the frequency of described the first storage chip is 13.56MHz, described the first storage chip is connected with a RFID antenna, the frequency of described the second storage chip is 900MHz, and described the second storage chip is connected with the 2nd RFID antenna; Communication unit, verification unit, the first encryption/decryption element and the second encryption/decryption element in described RFID control module are integrated in a microprocessor; Described microprocessor is connected with described the first storage chip and the second storage chip respectively.
The control method of electronic coded lock device as above, the method comprises:
Described electromechanical lock module receives the command message being sent by described RFID control module and described command message is carried out to verification, if verification is correct, send ACK message and carry out corresponding order to described RFID control module, and then send response message to described RFID control module; If check errors, sends NACK message to described RFID control module, resend command message by described RFID control module;
Described RFID control module receives the response message being sent by described electromechanical lock module and described response message is carried out to verification, if verification is correct, sends ACK message and enters the state that sends next command message of waiting for to described electromechanical lock module; If check errors, sends NACK message to described electromechanical lock module, resend response message by described electromechanical lock module;
Wherein, the command message between described RFID control module and described electromechanical lock module and the transmission of response message adopt foregoing data transmission method.
Wherein, described command message comprises status poll, initialization, unblanks and locking command message, and described response message comprises electromechanical lock state, initialization, unblanks and locking response message.
Wherein, the method specifically comprises step:
(1), described RFID control module sends status inquiry command message to described electromechanical lock module, whether described electromechanical lock module according to the initialization of status inquiry command message audit electromechanical lock module, if initialization, send initialization response message to described RFID control module, and the opening/closing lock status of inspection machine electric lock, send opening/closing lock status response message to described RFID control module; If no initializtion, sends no initializtion response message to described RFID control module;
(2) in the time that described RFID control module receives no initializtion response message, send initialization command message to described electromechanical lock module, described electromechanical lock module is carried out initialization command according to initialization command message, then sends initialization response message to described RFID control module;
(3) in the time that described RFID control module receives initialization response message, send and unblank or locking command message to described electromechanical lock module, described electromechanical lock module basis is unblanked or the execution of locking command message is unblanked or locking order, then sends and unblanks or locking response message to described RFID control module.
Wherein, described initialization command is only carried out once in the time that this electronic coded lock device uses first.
Beneficial effect:
The invention provides a kind of electronic coded lock device, this apparatus structure is simple, and cost is low; In this device, adopt a kind of data transmission method of encryption, solved the safety issue of transfer of data in electronic coded lock device.
Brief description of the drawings
The structured flowchart of the electronic coded lock device that Fig. 1 provides for the embodiment of the present invention.
The graphical representation of exemplary of the RFID control module that Fig. 2 provides for the embodiment of the present invention.
The graphical representation of exemplary of the RFID control module that Fig. 3 provides for the embodiment of the present invention and the intercommunication of electromechanical lock module.
The flow chart of steps of the data transmission method that Fig. 4 provides for the embodiment of the present invention.
The workflow schematic diagram of the RFID control module that Fig. 5 provides for the embodiment of the present invention.
The workflow schematic diagram of the electromechanical lock module that Fig. 6 provides for the embodiment of the present invention.
Embodiment
In order to set forth better technical characterstic of the present invention and structure, describe the present invention below in conjunction with embodiment and accompanying drawing thereof.
Consult Fig. 1, the electronic coded lock device that the present embodiment provides comprises RFID (Radio Frequency Identification, radio frequency identification) control module 1 and electromechanical lock module 2, wherein, described RFID control module 1 comprises memory cell 101, communication unit 104, verification unit 105, the first encryption/decryption element 102 and the second encryption/decryption element 103; Described electromechanical lock module 2 comprises memory cell 201, communication unit 204, verification unit 205, the first encryption/decryption element 202 and the second encryption/decryption element 203.Wherein, memory cell 101,201 is set to storing initial key and communication key plaintext; Communication unit 104,204 is set to realize the intercommunication of RFID control module 1 and electromechanical lock module 2; The first encryption/decryption element 102,202 is set to carry out CRC8 checking algorithm and carries out a des encryption computing; The second encryption/decryption element 103,203 is set to repeatedly des encryption algorithm; Verification unit 105,205 is set to the data of transmission between described RFID control module 1 and electromechanical lock module 2 to carry out verification.
As shown in Figure 2, in the present embodiment, memory cell 101 in RFID control module 1 comprises the first storage chip 20 and the second storage chip 30, wherein, the frequency of described the first storage chip 20 is 13.56MHz, described the first storage chip 20 is connected with a RFID antenna 40, and the frequency of described the second storage chip 30 is 900MHz, and described the second storage chip 30 is connected with the 2nd RFID antenna 50; Communication unit 104, verification unit 105, the first encryption/decryption element 102 and the second encryption/decryption element 103 in described RFID control module 1 are integrated in a microprocessor 10.The RFID antenna 40 that the read-write equipment that is 13.56MHZ by frequency in outside is 13.56MHZ by frequency is to the interior data writing of the first storage chip 20, and microprocessor 10 is connected with the first storage chip 20 and reads data wherein; The 2nd RFID antenna 50 that the read-write equipment that is 900MHZ by frequency in outside is 900MHZ by frequency is to the interior data writing of the second storage chip 30, and microprocessor 10 is connected with the second storage chip 30 and reads data wherein.Described the first storage chip 20 and the second storage chip 30 are double nip storage chip.Wherein, the first storage chip 20 that frequency is 13.56MHz is security control chips, and security performance is higher; Frequency is that the second storage chip 30 of 900MHz is mainly used in long-range reading information, and security performance is relatively lower.
RFID control module 1 receives user instruction, then sends command message to electromechanical lock module 2, and electromechanical lock module 2 is carried out verification to data after receiving command message, if verification is correct, carries out corresponding order and sends response message to RFID control module 1.Fig. 3 is the graphical representation of exemplary of the intercommunication of RFID control module 1 and electromechanical lock module 2.As shown in Figure 3, first RFID control module 1 sends command message to electromechanical lock module 2, electromechanical lock module 2 is carried out verification to data after receiving command message, after finishing, verification sends ACK or NACK message (herein to RFID control module 1, ACK message is the feedback command that verification is correct, and NACK message is the feedback command of check errors); Electromechanical lock module 2 sends response message to RFID control module 1 after the corresponding order of execution, RFID control module 1 is carried out verification to data after receiving response message, after verification finishes, send ACK or NACK message to electromechanical lock module 2, and then enter the link that sends next command message.
Wherein, the above command message comprises status poll, initialization, unblanks and locking command message, and described response message comprises electromechanical lock state, initialization, unblanks and locking response message.
Wherein, in the present embodiment, described command message and response message are by " instruction head+test serial number+director data " composition, and length is 24 bytes.Command message and response message can be called instruction message, are included in message data, and message data is made up of " lead code+length+instruction message ".Between RFID control module 1 and electromechanical lock module 2, realize the transmission of command message and response message by transmitting message data.Introduce below in electronic coded lock device as shown in Figure 1, the method for transmitting message data between RFID control module 1 and electromechanical lock module 2, wherein relates to the step that command message and response message are encrypted.
Taking RFID control module 1 to electromechanical lock module 2 transmission command messages as example, as shown in Figure 4.
First perform step S1~S5 by RFID control module 1:
S1, described message data is carried out to CRC8 checking algorithm, so that user instruction is carried out to completeness check, obtain the first crc value.Wherein, CRC8 checking algorithm is: CRC8-CCITT, X8+X7+X3+X2+1.
S2, employing communication key are expressly carried out a des encryption computing to the test serial number in command message, obtain communication process key.Carry out once to encrypt obtaining a communication process key, wherein, if 8 of the byte deficiencies of test serial number, right benefit 0x00 to 8 byte.
S3, command message is divided into three parts in order: front 8 bytes, in 8 bytes and rear 8 bytes.
S4, adopt described communication process key to command message carry out three des encryption computings.Particularly, adopt described communication process key to carry out a des encryption computing to described front 8 bytes, the result obtaining again with described in 8 bytes carry out step-by-step XORs, obtain the first encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains the second encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains a MAC value.In this step, adopt true random number computing, different cryptographic calculations all obtains different results each time, can not repeat.
S5, message data and the first crc value and a MAC value are transferred to electromechanical lock module.
Then perform step S6~S7 by electromechanical lock module 2:
S6, to the message data receiving, with reference to step S1~S4, calculate and obtain the second crc value and the 2nd MAC value.
S7, data check: contrast the first crc value and the second crc value and contrast the one MAC value and the 2nd MAC value, if identical, verification is correct; If different, check errors.
According to above step, complete once and send command message from RFID control module 1 to electromechanical lock module 2.It should be noted that, the step from electromechanical lock module 2 to RFID control module 1 and the above-mentioned difference that send response message from are, first perform step S1~S5 by electromechanical lock module 2, then perform step S6~S7 by RFID control module 1.
It should be noted that, in the time using this electronic coded lock device first, need to carry out initialization to electromechanical lock module 2.Specifically comprise: adopt initial key expressly to carry out a des encryption computing to communication key in RFID control module 1, obtain communication key ciphertext and be sent to electromechanical lock module 2; After electromechanical lock module 2 receives communication key ciphertext, use initial key to be decrypted and to obtain described communication key expressly and preserve described communication key ciphertext, complete initialization.
The electronic coded lock device that the present embodiment provides is mainly to carry out controller electric lock module by RFID control module, realizing query State, initialization, unblank and the function of locking.Its concrete control method is as follows:
(1), described RFID control module 1 sends status inquiry command message to described electromechanical lock module 2, whether described electromechanical lock module 2 according to the initialization of status inquiry command message audit electromechanical lock module, if initialization, send initialization response message to described RFID control module 1, and the opening/closing lock status of inspection machine electric lock, send opening/closing lock status response message to described RFID control module 1; If no initializtion, sends no initializtion response message to described RFID control module 1.
(2) in the time that described RFID control module 1 receives no initializtion response message, send initialization command message to described electromechanical lock module 2, described electromechanical lock module 2 is carried out initialization command according to initialization command message, then sends initialization response message to described RFID control module 1.
(3) in the time that described RFID control module 1 receives initialization response message, send and unblank or locking command message to described electromechanical lock module 2, described electromechanical lock module 2 bases are unblanked or the execution of locking command message is unblanked or locking order, then send and unblank or locking response message to described RFID control module 1.
Consult Fig. 5 and Fig. 6 below and illustrate the workflow of RFID control module 1 and electromechanical lock module 2.
The workflow schematic diagram of the RFID control module that Fig. 5 provides for the embodiment of the present invention; The workflow schematic diagram of the electromechanical lock module that Fig. 6 provides for the embodiment of the present invention.As illustrated in Figures 5 and 6:
(1) provide power supply to RFID control module 1 and electromechanical lock module 2.
(2) at RFID control module 1 end: RFID control module 1 sends status inquiry command message and receives the ACK or the NACK message that send from electromechanical lock module 2 to electromechanical lock module 2, if what receive is NACK message, again send status inquiry command message to electromechanical lock module 2, if what receive is ACK message, further receive the status poll response message sending from electromechanical lock module 2.At electromechanical lock module 2 ends: carry out CRC8 verification and MAC verification after electromechanical lock module 2 receives status inquiry command message, if check errors sends NACK message; If verification is correct, sends ACK message and further judge whether initialization of electromechanical lock, if initialization sends initialization response message, if no initializtion sends no initializtion response message.
(3) at RFID control module 1 end: RFID control module 1 is carried out CRC8 verification and MAC verification to the status poll response message receiving, if check errors sends NACK message to electromechanical lock module 2; If verification is correct, sends ACK message to electromechanical lock module 2, and further judge whether initialization of electromechanical lock from status poll response message.Electromechanical lock module 2 ends: receive the ACK or the NACK message that send from RFID control module 1, if what receive is NACK message, again send status poll response message to RFID control module 1, if what receive is ACK message, wait for next command message sending from RFID control module 1.
If (4-a) electromechanical lock no initializtion, at RFID control module 1 end: RFID control module 1 sends initialization command message to electromechanical lock module 2, and receive the ACK or the NACK message that send from electromechanical lock module 2, if what receive is NACK message, again send initialization command message to electromechanical lock module 2, if what receive is ACK message, further receive the initialization response message sending from electromechanical lock module 2.At electromechanical lock module 2 ends: carry out CRC8 verification and MAC verification after electromechanical lock module 2 receives initialization command message, if check errors sends NACK message; If verification is correct, sends ACK message and carry out initialization command and then send initialization response message to RFID control module 1.
(5-a) at RFID control module 1 end: RFID control module 1 is carried out CRC8 verification and MAC verification to the initialization response message receiving, if check errors sends NACK message to electromechanical lock module 2; If verification is correct, send ACK message to electromechanical lock module 2; Next command message to be sent such as then enter.Electromechanical lock module 2 ends: receive the ACK or the NACK message that send from RFID control module 1, if what receive is NACK message, again send initialization response message to RFID control module 1, if what receive is ACK message, wait for next command message sending from RFID control module 1.
If (4-b) electromechanical lock initialization, at RFID control module 1 end: RFID control module 1 sends just opening/closing lock command message to electromechanical lock module 2, and receive the ACK or the NACK message that send from electromechanical lock module 2, if what receive is NACK message, again send opening/closing lock command message to electromechanical lock module 2, if what receive is ACK message, further receive the opening/closing lock response message sending from electromechanical lock module 2.At electromechanical lock module 2 ends: electromechanical lock module 2 is carried out CRC8 verification and MAC verification after receiving opening/closing lock command message, if check errors sends NACK message; If verification is correct, sends ACK message and carry out opening/closing lock order and then send opening/closing lock response message to RFID control module 1.
(5-b) at RFID control module 1 end: RFID control module 1 is carried out CRC8 verification and MAC verification to the opening/closing lock response message receiving, if check errors sends NACK message to electromechanical lock module 2; If verification is correct, send ACK message to electromechanical lock module 2; Next command message to be sent such as then enter.Electromechanical lock module 2 ends: receive the ACK or the NACK message that send from RFID control module 1, if what receive is NACK message, again send opening/closing lock response message to RFID control module 1, if what receive is ACK message, wait for next command message sending from RFID control module 1.
Because initialization procedure only carries out in the time that this device uses first, therefore at step (4-b), RFID control module 1 can also send opening/closing lock status querying command message to electromechanical lock module 2, is in unblanking or blocking with enquiry machine electric lock; Accordingly, can be from receive opening/closing lock status inquiry response message to electromechanical lock module 2.
In sum, the electronic coded lock device the invention provides, this apparatus structure is simple, and cost is low; In this device, adopt a kind of data transmission method of encryption, solved the safety issue of transfer of data in electronic coded lock device.
It should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Although the present invention is described in detail and shows with reference to its exemplary embodiment, but will be understood by those skilled in the art that, in the case of not departing from the spirit and scope of the present invention that are defined by the claims, can carry out to it various changes of form and details.

Claims (12)

1. a data transmission method, for transmitting message data between first terminal and the second terminal, comprise the step that the instruction message in described message data is encrypted, it is characterized in that, described instruction message is made up of instruction head, test serial number and director data, and length is 24 bytes; Wherein, step instruction message being encrypted specifically comprises:
Carry out at first terminal:
(a), employing communication key is expressly carried out a des encryption computing to described test serial number, acquisition communication process key;
(b), described instruction message is divided into three parts in order: front 8 bytes, in 8 bytes and rear 8 bytes;
(c), adopt described communication process key to carry out a des encryption computing to described front 8 bytes, the result obtaining again with described in 8 bytes carry out step-by-step XORs, obtain the first encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains the second encrypted result; Adopt described communication process key to carry out a des encryption computing to described the first encrypted result, the result obtaining is carried out step-by-step XORs with described rear 8 bytes again, obtains a MAC value;
(d), message data and a MAC value are transferred to the second terminal by first terminal;
Carry out in the second terminal:
(e), to the message data receiving, with reference to step (a), (b) and (c), calculate and obtain the 2nd MAC value;
(f), data check: contrast a MAC value and the 2nd MAC value, if identical, verification is correct; If different, check errors.
2. data transmission method according to claim 1, is characterized in that, also comprises step: at first terminal, described message data is carried out to CRC8 checking algorithm, so that user instruction is carried out to completeness check, obtain the first crc value and send to the second terminal; The second terminal obtains the second crc value to described message data execution CRC8 checking algorithm after receiving described message data; In the step of data check, also crc value is carried out to verification, contrast the first crc value and the second crc value, if identical, verification is correct; If different, check errors.
3. data transmission method according to claim 2, is characterized in that, described CRC8 checking algorithm is: CRC8-CCITT, X8+X7+X3+X2+1.
4. data transmission method according to claim 1, is characterized in that, in step (a), if 8 of the byte deficiencies of test serial number, right benefit 0x00 to 8 byte.
5. according to the arbitrary described data transmission method of claim 1-4, it is characterized in that, in the time using first terminal and the second terminal first, carry out initialized step, specifically comprise: adopt initial key expressly to carry out a des encryption computing to communication key at first terminal, obtain communication key ciphertext and be sent to the second terminal; After the second terminal receives communication key ciphertext, use initial key to be decrypted and to obtain described communication key expressly and preserve described communication key ciphertext, complete initialization.
6. an electronic coded lock device, comprises RFID control module and electromechanical lock module, it is characterized in that, described RFID control module and electromechanical lock module comprise respectively memory cell, communication unit, verification unit, the first encryption/decryption element and the second encryption/decryption element; Between described RFID control module and electromechanical lock module, adopt the data transmission method transmitting message data described in claim 1-5, wherein,
Memory cell is set to storing initial key and communication key plaintext;
Communication unit is set to realize the intercommunication of described RFID control module and electromechanical lock module;
The first encryption/decryption element is set to carry out CRC8 checking algorithm and carries out a des encryption computing;
The second encryption/decryption element is set to repeatedly des encryption algorithm;
The data that verification unit is set to transmitting between described RFID control module and electromechanical lock module are carried out verification.
7. electronic coded lock device according to claim 6, is characterized in that, described the second ciphering unit is carried out 3 des encryption algorithms.
8. electronic coded lock device according to claim 6, it is characterized in that, memory cell in described RFID control module comprises the first storage chip and the second storage chip, wherein, the frequency of described the first storage chip is 13.56MHz, described the first storage chip is connected with a RFID antenna, and the frequency of described the second storage chip is 900MHz, and described the second storage chip is connected with the 2nd RFID antenna; Communication unit, verification unit, the first encryption/decryption element and the second encryption/decryption element in described RFID control module are integrated in a microprocessor; Described microprocessor is connected with described the first storage chip and the second storage chip respectively.
9. the control method of the arbitrary described electronic coded lock device of claim 6-8, described electronic coded lock device comprises RFID control module and electromechanical lock module, it is characterized in that, the method comprises:
Described electromechanical lock module receives the command message being sent by described RFID control module and described command message is carried out to verification, if verification is correct, send ACK message and carry out corresponding order to described RFID control module, and then send response message to described RFID control module; If check errors, sends NACK message to described RFID control module, resend command message by described RFID control module;
Described RFID control module receives the response message being sent by described electromechanical lock module and described response message is carried out to verification, if verification is correct, sends ACK message and enters the state that sends next command message of waiting for to described electromechanical lock module; If check errors, sends NACK message to described electromechanical lock module, resend response message by described electromechanical lock module;
Wherein, the data transmission method described in the transmission of the command message between described RFID control module and described electromechanical lock module and response message employing claim 1-5.
10. control method according to claim 9, is characterized in that, described command message comprises status poll, initialization, unblanks and locking command message, and described response message comprises electromechanical lock state, initialization, unblanks and locking response message.
11. control methods according to claim 10, is characterized in that, the method specifically comprises step:
(1), described RFID control module sends status inquiry command message to described electromechanical lock module, whether described electromechanical lock module according to the initialization of status inquiry command message audit electromechanical lock module, if initialization, send initialization response message to described RFID control module, and the opening/closing lock status of inspection machine electric lock, send opening/closing lock status response message to described RFID control module; If no initializtion, sends no initializtion response message to described RFID control module;
(2) in the time that described RFID control module receives no initializtion response message, send initialization command message to described electromechanical lock module, described electromechanical lock module is carried out initialization command according to initialization command message, then sends initialization response message to described RFID control module;
(3) in the time that described RFID control module receives initialization response message, send and unblank or locking command message to described electromechanical lock module, described electromechanical lock module basis is unblanked or the execution of locking command message is unblanked or locking order, then sends and unblanks or locking response message to described RFID control module.
12. according to the control method described in claim 10 or 11, it is characterized in that, described initialization command is only carried out once in the time that this electronic coded lock device uses first.
CN201410364199.6A 2014-07-28 2014-07-28 Data transmission method, electronic coded lock device and control method thereof Active CN104104499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410364199.6A CN104104499B (en) 2014-07-28 2014-07-28 Data transmission method, electronic coded lock device and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410364199.6A CN104104499B (en) 2014-07-28 2014-07-28 Data transmission method, electronic coded lock device and control method thereof

Publications (2)

Publication Number Publication Date
CN104104499A true CN104104499A (en) 2014-10-15
CN104104499B CN104104499B (en) 2017-05-24

Family

ID=51672328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410364199.6A Active CN104104499B (en) 2014-07-28 2014-07-28 Data transmission method, electronic coded lock device and control method thereof

Country Status (1)

Country Link
CN (1) CN104104499B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430605A (en) * 2015-12-10 2016-03-23 飞天诚信科技股份有限公司 Bluetooth master and slave devices and method for establishing safety channel between same
CN107395340A (en) * 2017-06-14 2017-11-24 云丁网络技术(北京)有限公司 Data transmission method, apparatus and system
WO2018090563A1 (en) * 2016-11-15 2018-05-24 华为技术有限公司 Bus security protection method and apparatus
CN111345768A (en) * 2018-12-20 2020-06-30 重庆金山医疗器械有限公司 Picture integrity checking method, communication device and capsule endoscope system
CN112671748A (en) * 2020-12-18 2021-04-16 深圳中科智能技术有限公司 Traceable encrypted data transmission method and system
CN114389755A (en) * 2022-01-12 2022-04-22 上海黑眸智能科技有限责任公司 Data verification method, device, storage medium and terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428617A (en) * 1991-04-16 1995-06-27 Matsushita Electric Industrial Co., Ltd. Data transmission system for portable terminal device
CN102025484A (en) * 2010-12-17 2011-04-20 北京航空航天大学 Block cipher encryption and decryption method
CN102333093A (en) * 2011-09-28 2012-01-25 深圳市赛格导航科技股份有限公司 Data encryption transmission method and system
CN102594549A (en) * 2012-03-22 2012-07-18 山东泰信电子有限公司 Multistage data encryption and decryption methods

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428617A (en) * 1991-04-16 1995-06-27 Matsushita Electric Industrial Co., Ltd. Data transmission system for portable terminal device
CN102025484A (en) * 2010-12-17 2011-04-20 北京航空航天大学 Block cipher encryption and decryption method
CN102333093A (en) * 2011-09-28 2012-01-25 深圳市赛格导航科技股份有限公司 Data encryption transmission method and system
CN102594549A (en) * 2012-03-22 2012-07-18 山东泰信电子有限公司 Multistage data encryption and decryption methods

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430605A (en) * 2015-12-10 2016-03-23 飞天诚信科技股份有限公司 Bluetooth master and slave devices and method for establishing safety channel between same
CN105430605B (en) * 2015-12-10 2018-09-25 飞天诚信科技股份有限公司 A kind of method that bluetooth master-slave equipment and the two establish escape way
WO2018090563A1 (en) * 2016-11-15 2018-05-24 华为技术有限公司 Bus security protection method and apparatus
CN107395340A (en) * 2017-06-14 2017-11-24 云丁网络技术(北京)有限公司 Data transmission method, apparatus and system
US11362838B2 (en) 2017-06-14 2022-06-14 Yunding Network Technology Beijing Co., Ltd. Systems and methods for secure data transmission
US11831784B2 (en) 2017-06-14 2023-11-28 Yunding Network Technology (Beijing) Co., Ltd. Systems and methods for secure data transmission
CN111345768A (en) * 2018-12-20 2020-06-30 重庆金山医疗器械有限公司 Picture integrity checking method, communication device and capsule endoscope system
CN112671748A (en) * 2020-12-18 2021-04-16 深圳中科智能技术有限公司 Traceable encrypted data transmission method and system
CN114389755A (en) * 2022-01-12 2022-04-22 上海黑眸智能科技有限责任公司 Data verification method, device, storage medium and terminal
CN114389755B (en) * 2022-01-12 2023-08-11 深圳华芯信息技术股份有限公司 Data verification method and device, storage medium and terminal

Also Published As

Publication number Publication date
CN104104499B (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN104104499A (en) Data transmission method, electronic coded lock device and control method thereof
Peris-Lopez et al. Advances in ultralightweight cryptography for low-cost RFID tags: Gossamer protocol
US10909532B2 (en) POS system with white box encryption key sharing
CN102377566B (en) Security processing device and system for electric meter data
CN104488219A (en) Methods and system for secure communication between an rfid tag and a reader
EP3563516B1 (en) Pseudo-random generation of matrices for a computational fuzzy extractor and method for authentication
CN102196375A (en) Securing out-of-band messages
CN102640448A (en) System and method for securely identifying and authenticating devices in a symmetric encryption system
CN103413109A (en) Bidirectional authentication method of radio frequency identification system
EP2996277B1 (en) Securing a crytographic device against implementation attacks
US20160013933A1 (en) Order-preserving encryption system, device, method, and program
CN102970676A (en) Method for processing original data, internet of thing system and terminal
CN101425895A (en) Cipher generating device, ciphering and deciphering method for electronic equipment software
Fu et al. A low‐cost UHF RFID tag chip with AES cryptography engine
CN101540675B (en) Smart key equipment and communication method and system of application software
CN107425976A (en) Key chip system and internet of things equipment
CN109145613A (en) Security encryption chip and electronic equipment containing the chip
US20110107097A1 (en) Method for encoded data exchange and communication system
WO2018122233A1 (en) Robust computational fuzzy extractor and method for authentication
US20140153723A1 (en) System for providing physical layer security
CN102403037A (en) Chip burning base and method
O'Neill et al. Low-cost digital signature architecture suitable for radio frequency identification tags
Peris-Lopez et al. Lightweight cryptography for low-cost RFID tags
CN102246456A (en) System and method for countering side-channel attacks against encryption based on cyclic groups
Choi et al. A Fully Integrated CMOS Security‐Enhanced Passive RFID Tag

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant