CN113849866B - Method, device, storage medium and equipment for self-decryption of one-wire telephone - Google Patents

Method, device, storage medium and equipment for self-decryption of one-wire telephone Download PDF

Info

Publication number
CN113849866B
CN113849866B CN202111117900.0A CN202111117900A CN113849866B CN 113849866 B CN113849866 B CN 113849866B CN 202111117900 A CN202111117900 A CN 202111117900A CN 113849866 B CN113849866 B CN 113849866B
Authority
CN
China
Prior art keywords
data
wire
decrypted
key
nonce
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.)
Active
Application number
CN202111117900.0A
Other languages
Chinese (zh)
Other versions
CN113849866A (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.)
Chongqing Siqi Technology Co ltd
Original Assignee
Chongqing Siqi Technology 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 Chongqing Siqi Technology Co ltd filed Critical Chongqing Siqi Technology Co ltd
Priority to CN202111117900.0A priority Critical patent/CN113849866B/en
Publication of CN113849866A publication Critical patent/CN113849866A/en
Application granted granted Critical
Publication of CN113849866B publication Critical patent/CN113849866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/72Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in cryptographic circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a method for self-decrypting a digital subscriber line, which comprises the steps of obtaining digital subscriber line data according to a level change signal of a detected pin; if the data of the all-wire digital network needs to be decrypted, obtaining the secret key according to the equipment number and the serial number read from the data of the all-wire digital network, and decrypting the data of the all-wire digital network by using the secret key to obtain decrypted data; and verifying the decrypted data, and if the verification is successful, successfully analyzing the data of the one-line communication. According to the invention, the data of each controller does not need to be analyzed independently, and the decrypted data of the one-wire telephone is obtained, so that the research and development time can be effectively saved. The invention also relates to a device, equipment and a storage medium for the one-wire self-decryption.

Description

Method, device, storage medium and equipment for self-decryption of one-wire telephone
Technical Field
The invention relates to the technical field of industrial control, in particular to a method, a device, a storage medium and equipment for one-line communication self-decryption.
Background
At present, the domestic electric vehicles mostly adopt a one-wire communication mode to carry out information communication between a controller and an instrument. Although the SIF communication protocol of the international standard is adopted between the interfaces, the level also complies with the TTL specification, but the universality of the one-wire communication interface can be only maintained. In the actual development process, the number of bytes of the data of the cable and whether the data is encrypted are completely determined by a manufacturer of the controller, so that the meters produced by the meter manufacturer can only be correspondingly applied to one controller, the meter manufacturer needs to spend a large amount of time for matching and debugging the controllers of different models, and the research and development period of the manufacturer is increased.
Disclosure of Invention
The present invention provides a method, an apparatus, a storage medium and a device for a single-wire self-decryption, which are used to solve the technical problem of the prior art.
The technical scheme for solving the technical problems is as follows:
a method of one-wire self-decryption, the method comprising:
obtaining one-wire data according to the detected level change signal of the pin;
if the data of the all-wire digital network needs to be decrypted, obtaining the secret key according to the equipment number and the serial number read from the data of the all-wire digital network, and decrypting the data of the all-wire digital network by using the secret key to obtain decrypted data;
and verifying the decrypted data, and if the verification is successful, successfully analyzing the data of the one-line communication.
The method has the beneficial effects that: a method for self-decrypting a digital network is provided, which comprises obtaining digital network data according to a level change signal of a detected pin; if the data of the all-wire digital network needs to be decrypted, obtaining the secret key according to the equipment number and the serial number read from the data of the all-wire digital network, and decrypting the data of the all-wire digital network by using the secret key to obtain decrypted data; and verifying the decrypted data, and if the verification is successful, successfully analyzing the data of the one-line communication. According to the invention, the data of each controller does not need to be analyzed independently, and the decrypted data of the one-wire telephone is obtained, so that the research and development time can be effectively saved.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the obtaining of a wire data according to the detected level change signal of the pin specifically includes:
when the level of a pin connected with a wire harness is changed, beginning to receive the wire harness data;
determining data of a corresponding bit in the one-wire data according to the duration of a low level in one period;
and obtaining the data length of the one-line communication data according to the obtained digit of the one-line communication data.
Further, if the data of the one-line network needs to be decrypted, the method specifically includes:
when the byte of the preset fixed position in the Yinlong data is a fixed value, the Yinlong data is not encrypted;
otherwise the one-wire data needs to be decrypted.
Further, the method includes obtaining the key according to the device number and the serial number read from the data of the one-line network, and decrypting the data of the one-line network by using the key to obtain decrypted data, and specifically includes:
obtaining the equipment number from the first bit data of the one-wire communication data;
determining a corresponding key algorithm from a preset key algorithm library according to the equipment number;
calculating the serial number in the data of the one-line communication by adopting the key algorithm to obtain the key;
decrypting the one-line communication data by using the key to obtain decrypted data;
and carrying out preliminary verification on the decrypted data, wherein if the preliminary verification is passed, the decrypted data is correct.
Further, the calculating the serial number in the data of the one-line service by using the key algorithm to obtain the key specifically includes:
accumulating the low byte of the first serial number in the one-line data with a first accumulated number in the key algorithm, and then performing exclusive or operation with a first exclusive or number in the key algorithm to obtain a first nonce;
after the first nonce and a second accumulated number in the key algorithm are subjected to accumulation operation, the first nonce and a second XOR number in the key algorithm are subjected to XOR operation to obtain a second nonce;
performing and operation on the high byte of the second serial number in the one-line data and 0x0F, and accumulating the high byte and the second temporary number to obtain a third nonce;
performing accumulation operation on the third nonce and a fourth accumulated number in the key algorithm, and performing exclusive-or operation on the third nonce and a fourth exclusive-or number in the key algorithm to obtain a fourth nonce;
and reserving the last seven digits of the fourth nonce in the binary form to obtain the key.
Further, the decrypting the all-wire data with the key to obtain the decrypted data specifically includes:
acquiring data on each data bit in the one-wire data;
and accumulating the data on other data bits except the data on the fifth data bit with the key respectively, and then carrying out exclusive OR operation on all the data on the data bits and the equipment number to obtain the decrypted data.
Further, the verifying the decrypted data, and if the verification is successful, the analyzing the data of the all-wire network is successful, specifically including:
and checking the check bit of the last byte in the decrypted data, and if the check is successful, successfully analyzing the data of the one-wire communication.
Another technical solution of the present invention for solving the above technical problems is as follows:
a one-wire self-decrypting device, the device comprising:
the detection module is used for obtaining one-wire data according to the detected level change signal of the pin;
the decryption module is used for obtaining the secret key according to the equipment number and the serial number read from the one-line communication data if the one-line communication data needs to be decrypted, and decrypting the one-line communication data by using the secret key to obtain decrypted data;
and the verification module is used for verifying the decrypted data, and if the verification is successful, the analysis of the data of the one-line communication is successful.
Furthermore, the present invention provides an arithmetic machine readable storage medium, on which an arithmetic machine program is stored, which program, when executed by a processor, implements the steps of a method for a wire-based self-decryption according to any of the above-mentioned technical solutions.
The invention further provides an electronic device, which includes a memory, a processor and an arithmetic computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the method for one-wire self-decryption according to any one of the above technical solutions when executing the program.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention or in the description of the prior art will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for a one-wire self-decryption according to an embodiment of the present invention;
fig. 2 is a block diagram of an apparatus for a wire-based self-decryption according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, shall fall within the scope of protection of the present invention.
It should be understood that, in order to solve the problem caused by the non-uniform and non-standard data of the unified cable network in the development process, the application provides a method for automatically decrypting encrypted data by self-analyzing the number of the data of the unified cable network by a program. When the controller is connected with the instrument device, the Linux system identifies and reads data of the first-line communication, the number of bytes of the first-line communication data is identified in the process, the data are distinguished in types, different types have different key algorithms, corresponding keys are calculated through the types, finally the first-line communication data are decrypted through the keys, and the data are forwarded after the decryption is successful.
For the prior art, the method and the device can automatically judge and analyze most data of the one-line communication. The former meter can only analyze the data sent by one controller, and if the other controller is replaced, only the other meter matched with the controller can be produced again. And one instrument cannot be detached and installed on a vehicle with another controller, and the secondary utilization of the instrument is not facilitated. The all-wire-through data of most controllers can be automatically analyzed, and the function that one instrument is repeatedly installed on different vehicles of various controllers is achieved. Before, each type of controller needs to be analyzed by research personnel, the workload of the research personnel is increased, and the research personnel can directly obtain analyzed data in most controllers by using the method, so that the research and development time is saved. The method and the device for processing the data judge and process the data processing mode, so that a large amount of data processing is not needed to be stored, any additional equipment is not needed to be added, and only one chip is needed to run a program in the chip. When the processing method of the data is identified for the first time, the processing method is recorded, and the processing method can be directly reused after the computer is turned on and off, so that the required data can be obtained immediately. And meanwhile, a reset function is also provided, and when the instrument is replaced by another controller, the reset instrument re-identifies the processing method of the data in the new controller.
As shown in fig. 1, the method for one-wire self-decryption according to the embodiment of the present invention includes the following steps:
110. and obtaining one-wire data according to the detected level change signal of the pin.
120. And if the data of the all-wire network needs to be decrypted, obtaining the secret key according to the equipment number and the serial number read from the data of the all-wire network, and decrypting the data of the all-wire network by using the secret key to obtain decrypted data.
130. And verifying the decrypted data, and if the verification is successful, successfully analyzing the data of the one-line communication.
Based on the foregoing embodiment, further, step 110 specifically includes:
111. when the level of a pin connected with a wire harness changes, the wire harness starts to receive data.
112. And determining the data of the corresponding bit in the one-wire data according to the duration of the low level in one period.
113. And obtaining the data length of the Yixiantong data according to the obtained digits of the Yixiantong data.
Further, the step 120 of determining whether the data of the one-wire network needs to be decrypted specifically includes:
when the byte of the preset fixed position in the one-wire data is a fixed value, the one-wire data is not encrypted.
Otherwise the one-wire data needs to be decrypted.
Further, in step 120, the key is obtained according to the device number and the serial number read from the all-wire digital network data, and the all-wire digital network data is decrypted by using the key to obtain decrypted data, which specifically includes:
121. and obtaining the equipment number from the first bit data of the one-wire data.
122. And determining a corresponding key algorithm from a preset key algorithm library according to the equipment number.
123. And calculating the serial number in the data of the XN line card by adopting the key algorithm to obtain the key.
124. And decrypting the one-line communication data by using the key to obtain decrypted data.
125. And carrying out preliminary verification on the decrypted data, wherein if the preliminary verification is passed, the decrypted data is correct.
Further, step 122 specifically includes:
accumulating the low byte of the first serial number in the one-line data with a first accumulated number in the key algorithm, and then performing exclusive or operation with a first exclusive or number in the key algorithm to obtain a first nonce;
after the first nonce and a second accumulated number in the key algorithm are subjected to accumulation operation, the first nonce and a second XOR number in the key algorithm are subjected to XOR operation to obtain a second nonce;
performing and operation on the high byte of the second serial number in the one-line data and 0x0F, and accumulating the high byte and the second temporary number to obtain a third nonce;
performing accumulation operation on the third nonce and a fourth accumulated number in the key algorithm, and performing exclusive-or operation on the third nonce and a fourth exclusive-or number in the key algorithm to obtain a fourth nonce;
and reserving the last seven digits of the fourth nonce in the binary form to obtain the key.
Further, step 124 specifically includes:
and acquiring data on each data bit in the one-wire data.
And accumulating the data on other data bits except the data on the fifth data bit with the key respectively, and then carrying out exclusive OR operation on all the data on the data bits and the equipment number to obtain the decrypted data.
Further, step 130 specifically includes:
and checking the check bit of the last byte in the decrypted data, and if the check is successful, successfully analyzing the data of the one-wire communication.
It should be understood that, in the above embodiment, the filter and the analysis are performed on the one-line data, so as to calculate the information of the controller, such as the number of bytes of the one-line data, the encryption method, and the like in the program, and for the research and development personnel of the meter manufacturer, the research and development personnel do not need to perform separate analysis on the data of each type of controller to obtain the decrypted one-line data, so that the research and development time can be effectively saved.
For example, in the linux system, the data of the one-line communication is identified and read, and the data length of the one-line communication is calculated according to the signal length. The identification method can be realized by connecting a wire to a pin of the chip and detecting the specific level change of the pin by the system to confirm that the wire is a wire synchronization signal, namely a signal that the wire starts to send data. A wire harness records the level change of the pin, and judges that the data of the bit is 0 or 1 according to the duration of low level in one period. And calculating the bit number of the data read from the two signals, and obtaining the data length of the one-wire data by the bit number/8. And classifying the data of the one-wire communication according to the length of the data of the one-wire communication, whether the data is encrypted and other information. Judging whether the 2 nd byte in the data of the one-line communication is a fixed value, basically adopting a pipeline encryption method for the one-line communication protocol, and if the byte is fixed, judging that no encryption exists. And if the encryption is carried out, matching and decrypting the key. And calculating a secret key, decrypting the data of the cable, judging whether decryption is successful, if so, carrying out the next step, and otherwise, replacing the decryption mode. And if the encrypted data is encrypted, the equipment number is matched with a key algorithm according to the equipment number, and the data is decrypted after a key is obtained. The decrypted data is judged whether to be decrypted successfully through the following two points: 1. when the vehicle does not move, the sixth byte data in the wire-through data is 0; 2. the obtained vehicle speed should be less than 200 km/h. And (3) according to the data length, whether the data is encrypted or not and the serial number of the manufacturer equipment are matched with the analysis mode of the Yixian data, checking (XOR) by the check bit of the last byte in the Yixian data, and considering that the analysis is successful after the check is successful.
It should be understood that the format of a wire-line data is: data0 equipment number … Data1 streaming number low byte … Data2 streaming number high byte (4 bit) + Data (4 bit) … Data 3-Data 10 Data11 check bit; the equipment number is used for identifying manufacturers, and the data used for encryption of each manufacturer is different: if the serial number of one manufacturer is 0x25, the corresponding encryption mode is
PlusCode=(char)(SEQ_CODE_L+0xEA);
PlusCode=(char)(PlusCode^0xDB);
PlusCode=(char)(PlusCode+0xBF);
PlusCode=(char)(PlusCode^0x5A);
PlusCode=(char)(PlusCode+(SEQ_CODE_H&0x0F));
PlusCode=(char)(PlusCode^0x4B);
PlusCode=(char)(PlusCode+0xDB);
PlusCode=(char)(PlusCode^0xBD);
PlusCode=PlusCode&0x7F;
Another manufacturer is numbered 0x0A, which corresponds to encryption
PlusCode=(char)(SEQ_CODE_L+0x2c);
PlusCode=(char)(PlusCode^0x2A);
PlusCode=(char)(PlusCode+0x6E);
PlusCode=(char)(PlusCode^0x4B);
PlusCode=(char)(PlusCode+(SEQ_CODE_H&0x0F));
PlusCode=(char)(PlusCode^0xCD);
PlusCode=(char)(PlusCode+0xCA);
PlusCode=(char)(PlusCode^0x6A);
PlusCode=PlusCode&0x7F;
The serial number is used for encryption, and when Data1 is fixed bytes and does not change, the serial number is not encrypted, and when Data1 changes all the time, the serial number is encrypted. In the above key algorithm, SEQ _ CODE _ L is the lower byte of the serial number of Data1, and SEQ _ CODE _ H is the upper four bits of Data2, i.e. the upper byte of the serial number.
The algorithm for decryption is as follows:
DATA0 ═ device number;
DATA1=SEQ_CODE_L;
DATA2=(SEQ_CODE_H&0x0F)*0x10+staus1;
DATA3=staus2+PlusCode;
DATA4=staus3+PlusCode;
DATA5=staus4+PlusCode;
DATA6=staus5+PlusCode;
DATA7=staus6+PlusCode;
DATA8=staus7+PlusCode;
DATA9=staus8+PlusCode;
DATA10=staus9+PlusCode;
DATA11=staus10+PlusCode;
DATA12=staus11+PlusCode;
DATA13=staus12+PlusCode;
DATA14=DATA0^DATA1^DATA2^DATA3^…^DATA13。
as shown in fig. 2, the apparatus for a wire line self-decryption according to the embodiment of the present invention includes a detection module, configured to obtain a wire line data according to a level variation signal of a detected pin.
And the decryption module is used for obtaining the secret key according to the equipment number and the serial number read in the data of the one-line communication if the data of the one-line communication needs to be decrypted, and decrypting the data of the one-line communication by using the secret key to obtain decrypted data.
And the verification module is used for verifying the decrypted data, and if the verification is successful, the analysis of the data of the one-line communication is successful.
Furthermore, the present invention provides an operating machine readable storage medium, on which an operating machine program is stored, which when executed by a processor, implements the steps of the method for one-wire self-decryption according to any one of the above-mentioned technical solutions.
The invention further provides an electronic device, which includes a memory, a processor and an arithmetic computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the method for one-wire self-decryption according to any one of the above technical solutions when executing the program.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of both computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
Based on such understanding, all or part of the flow in the method according to the above embodiments may be implemented by instructing the related hardware through a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in source code form, object code form, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, Read-only memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the content of the computer readable medium may be increased or decreased as required by legislation and patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for a one-wire self-decryption, the method comprising:
obtaining one-wire data according to the detected level change signal of the pin;
if the data of the all-wire line is required to be decrypted, obtaining an equipment number from the first-bit data of the all-wire line;
determining a corresponding key algorithm from a preset key algorithm library according to the equipment number;
calculating the serial number in the Yixiantong data by adopting the key algorithm to obtain a key;
decrypting the one-line communication data by using the key to obtain decrypted data;
performing preliminary verification on the decrypted data, wherein if the preliminary verification is passed, the decrypted data is correct, and the analysis of the data of the one-line communication is successful;
the decrypting the data of the all-wire network by using the key to obtain the decrypted data specifically includes:
acquiring data on each data bit in the one-wire data;
and accumulating the data on other data bits except the data on the fifth data bit with the key respectively, and then carrying out exclusive OR operation on all the data on the data bits and the equipment number to obtain the decrypted data.
2. The method according to claim 1, wherein obtaining a wire-through data according to the detected level variation signal of the pin comprises:
when the level of a pin connected with a wire harness is changed, beginning to receive the wire harness data;
determining data of a corresponding bit in the one-wire data according to the duration of a low level in one period;
and obtaining the data length of the one-line communication data according to the obtained digit of the one-line communication data.
3. The method according to claim 1, wherein if the data of the all-wire network needs to be decrypted, the method specifically comprises:
when the byte of the preset fixed position in the Yinlong data is a fixed value, the Yinlong data is not encrypted;
otherwise the one-wire data needs to be decrypted.
4. The method according to claim 1, wherein the obtaining the secret key by performing an operation on a serial number in the data of the all-wire network using the secret key algorithm specifically includes:
accumulating the low byte of the first serial number in the one-line data with a first accumulated number in the key algorithm, and then performing exclusive or operation with a first exclusive or number in the key algorithm to obtain a first nonce;
after the first nonce and a second accumulated number in the key algorithm are subjected to accumulation operation, the first nonce and a second XOR number in the key algorithm are subjected to XOR operation to obtain a second nonce;
performing and operation on the high byte of the second serial number in the one-line data and 0x0F, and accumulating the high byte and the second temporary number to obtain a third nonce;
after the third nonce and a fourth accumulated number in the key algorithm are subjected to accumulation operation, the third nonce and a fourth XOR number in the key algorithm are subjected to XOR operation, and a fourth nonce is obtained;
and reserving the last seven digits of the fourth nonce in the binary form to obtain the key.
5. The method according to claim 1, wherein the preliminary verification is performed on the decrypted data, and if the preliminary verification is successful, the parsing of the data of the all-wire network is successful, specifically comprising:
and checking the check bit of the last byte in the decrypted data, and if the check is successful, successfully analyzing the data of the one-wire communication.
6. A one-wire self-decrypting apparatus, comprising:
the detection module is used for obtaining one-wire data according to the detected level change signal of the pin;
the decryption module is used for obtaining an equipment number from the first bit data of the one-line communication data if the one-line communication data needs to be decrypted; determining a corresponding key algorithm from a preset key algorithm library according to the equipment number; calculating the serial number in the Yixiantong data by adopting the key algorithm to obtain a key; decrypting the data of the front-end line system by using the key to obtain decrypted data;
the decrypting the data of the all-wire network by using the key to obtain decrypted data specifically includes:
acquiring data on each data bit in the one-wire data;
except the data on the fifth data bit, the data on other data bits are respectively accumulated with the key, and then the exclusive-or operation is carried out on all the data on the data bits and the equipment number to obtain the decrypted data;
and the verification module is used for preliminarily verifying the decrypted data, if the preliminary verification is successful, the decrypted data is correct, and the analysis of the data of the front-end service is successful.
7. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of a method for self-decrypting a wire line according to any one of claims 1 to 5.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of a method for self-decryption of a wire according to any of claims 1 to 5 when executing the program.
CN202111117900.0A 2021-09-17 2021-09-17 Method, device, storage medium and equipment for self-decryption of one-wire telephone Active CN113849866B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111117900.0A CN113849866B (en) 2021-09-17 2021-09-17 Method, device, storage medium and equipment for self-decryption of one-wire telephone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111117900.0A CN113849866B (en) 2021-09-17 2021-09-17 Method, device, storage medium and equipment for self-decryption of one-wire telephone

Publications (2)

Publication Number Publication Date
CN113849866A CN113849866A (en) 2021-12-28
CN113849866B true CN113849866B (en) 2022-09-16

Family

ID=78979432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111117900.0A Active CN113849866B (en) 2021-09-17 2021-09-17 Method, device, storage medium and equipment for self-decryption of one-wire telephone

Country Status (1)

Country Link
CN (1) CN113849866B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861892B (en) * 2017-09-26 2021-08-03 大唐微电子技术有限公司 Method and terminal for realizing data processing
CN109617675B (en) * 2018-11-15 2024-02-06 国网电动汽车服务有限公司 Method and system for authenticating identifiers of both sides between charge and discharge facility and user terminal
CN109815750A (en) * 2018-12-28 2019-05-28 深圳市德名利电子有限公司 A kind of encryption method and storage device of storage device
CN112511289B (en) * 2020-12-08 2022-05-27 中国科学院计算技术研究所数字经济产业研究院 Hardware decoding device supporting one-wire communication and radio frequency

Also Published As

Publication number Publication date
CN113849866A (en) 2021-12-28

Similar Documents

Publication Publication Date Title
CN110427785B (en) Equipment fingerprint acquisition method and device, storage medium and electronic device
CN103647648A (en) Safety communication method
CN113114659B (en) Diagnostic equipment detection method and device, terminal equipment and storage medium
CN112241345A (en) PCIE test method, system, terminal and storage medium
CN108763062B (en) Method for filtering buried point names and terminal equipment
CN108200387A (en) A kind of transmission method of file, system and camera
CN113225339A (en) Network security monitoring method and device, computer equipment and storage medium
CN110659899B (en) Offline payment method, device and equipment
CN113849866B (en) Method, device, storage medium and equipment for self-decryption of one-wire telephone
CN115314227B (en) Charging pile access authentication method, system and equipment
US10788809B2 (en) Method for the enabling of machine functions on a spinning-mill machine
CN112287402A (en) Data integrity checking method, system and device
CN115086172B (en) Data gateway plug-in updating method and device, electronic equipment and storage medium
CN110708286A (en) Supervision system for testing internet
CN112783942B (en) Block chain-based data acquisition quality verification method, system, device and medium
CN113761851B (en) Hydraulic unit engineering quality acceptance data acquisition system based on Internet of things
CN111026579B (en) Verification method and device for data error detection capability, terminal equipment and medium
CN111382050B (en) Network service interface testing method and device
CN108197456B (en) Equipment data caching method and device
CN101639883B (en) Method for checking PIN code and intelligent key equipment
CN117014223B (en) Concentrator, data transmission method and device thereof and storage medium
CN110135857B (en) Apple equipment verification method, terminal, server and system
CN117220935B (en) Network security monitoring system based on mobile computer
CN110147341B (en) 645 and 698 communication protocol compatible electric energy meter and communication method
CN110515914B (en) Log safety export method based on self-service terminal equipment

Legal Events

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