CN116015644A - Encryption module and decryption method using same - Google Patents
Encryption module and decryption method using same Download PDFInfo
- Publication number
- CN116015644A CN116015644A CN202211633483.XA CN202211633483A CN116015644A CN 116015644 A CN116015644 A CN 116015644A CN 202211633483 A CN202211633483 A CN 202211633483A CN 116015644 A CN116015644 A CN 116015644A
- Authority
- CN
- China
- Prior art keywords
- unit
- encryption
- decoding
- decryption
- control unit
- 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.)
- Pending
Links
Images
Landscapes
- Optical Communication System (AREA)
Abstract
The invention provides an encryption module and a decryption method using the same, wherein the encryption module comprises an encoding unit, a light emitting unit, a light receiving unit, a decoding unit, a control unit, an encryption and decryption unit and a comparison unit. According to the encryption module and the decryption method using the same, before decrypting the data ciphertext, the decoding result obtained through the encoding unit and the decoding unit is used as the verification parameter to be transmitted into the encryption and decryption unit for encryption algorithm operation, after the operation result is obtained, the comparison unit is used for verification, after the verification is successful, the encryption and decryption unit is used for decrypting the data ciphertext, the loophole existing in decryption by the main control chip is avoided, the product safety is improved, the intellectual property rights of developers are protected, the encryption module is simple in structure, low in cost and convenient to popularize and use.
Description
Technical Field
The invention relates to the technical field of integrated chips, in particular to an encryption module and a decryption method using the same.
Background
In the field of embedded applications, with the development of hacking technology and chip dissection technology in recent years, the attacks faced by embedded systems are increasing, so that research and development products have the risk of being shoveled.
The conventional encoder mode is easily influenced by other external matters, so that errors occur in the decoding and adding process, and the normal operation of the system is influenced. The general encryption chip adopts a data encryption and decryption working mode, the main control MCU stores a part of data ciphertext in the encryption chip, and when the main control MCU works, the ciphertext is read out from the encryption chip and then is decrypted into plaintext in the main control chip for use. However, the working mode has a loophole, if an intruder can debug disassembled codes, points are broken after data decryption, plaintext data in variables are obtained, and a product scheme can be successfully cracked.
Disclosure of Invention
The present invention is directed to the above-mentioned problems, and provides an encryption module and a decryption method using the same, which can solve one or more of the above-mentioned technical problems.
According to an aspect of the present invention, there is provided an encryption module including an encoding unit, a light emitting unit, a light receiving unit, a decoding unit, a control unit, an encryption and decryption unit, and a comparison unit; the input end of the coding unit is connected with the signal output end of the control unit, and the coding unit is used for receiving the standard code modulation output driving current sent by the control unit; the input end of the light emitting unit is connected with the output end of the coding unit, and the light emitting unit is used for outputting an optical signal under the action of driving current; the optical receiving unit is used for receiving the optical signal and converting the received optical signal into an electric signal; the input end of the decoding unit is respectively connected with the signal output end of the control unit and the output end of the light receiving unit, the decoding unit receives the standard code sent by the control unit and the electric signal converted by the light receiving unit, the decoding unit is used for decoding the received electric signal and comparing the decoding result with the standard code, and if the decoding result is matched with the standard code, the decoding unit outputs the decoding result to the control unit; the control unit is in communication connection with the encryption and decryption unit and is in communication connection with the comparison unit; the encryption and decryption unit is used for obtaining the decoding result sent by the control unit to carry out encryption operation, and sending the encryption operation result to the control unit, or carrying out decryption operation after receiving the decryption instruction sent by the control unit; the comparing unit is used for acquiring the encryption operation result and comparing the encryption operation result with the original code value, and returning a preset value to the control module if the encryption operation result is matched with the original code value; the control unit is used for receiving the decoding result sent by the decoding unit, sending the decoding result to the encryption and decryption unit for encryption operation, receiving the encryption operation result sent by the encryption and decryption unit, sending the encryption operation result to the comparison unit, receiving the preset value returned by the comparison unit, and sending the decryption instruction to the encryption and decryption unit.
In some embodiments, a signal amplifying unit is further disposed between the coding unit and the light emitting unit, an input end of the signal amplifying unit is connected to an output end of the coding unit, an output end of the signal amplifying unit is connected to an input end of the light emitting unit, and the signal amplifying unit is used for amplifying the driving current output by the coding unit.
In some embodiments, the light emitting unit is a light emitting diode and the light receiving unit is a photoresistor.
In some embodiments, the light emitting unit and the light receiving unit are integrated in a photosensitive sensing device, the photosensitive sensing device comprises a housing, one side in the housing is provided with the light emitting unit, the light emitting unit is connected with a first pin, the first pin extends out of the housing, the opposite side of the light emitting unit in the housing is provided with the light receiving unit, the light receiving unit is connected with a second pin, and the second pin extends out of the housing.
In some embodiments, the housing is a darkroom shielding housing.
In some embodiments, a filtering unit is disposed between the light receiving unit and the decoding unit, an input end of the filtering unit is connected to an output end of the light receiving unit, and an output end of the filtering unit is connected to an input end of the decoding unit.
In some embodiments, the control unit is a chip of model STM32F103RCT6, and the encryption and decryption unit is a chip of model ESPU 0808.
According to another aspect of the present invention, there is provided a decryption method, applying the encryption module of any one of the above, comprising the steps of:
step 1.1: the coding unit acquires the standard code sent by the control unit, and outputs driving current after modulation;
step 1.2: the light emitting unit outputs a light signal under the action of a driving current;
step 1.3: the light receiving unit receives the light signal output by the light emitting unit and converts the light signal into an electric signal to be output;
step 1.4: the decoding unit acquires and decodes the electric signal output by the light receiving unit;
step 1.5: the decoding unit compares the decoding result with the standard code acquired from the control unit, if the decoding result is matched with the standard code, the step 1.6 is executed, and if the decoding result is not matched with the standard code, the step 1.7 is executed;
step 1.6: the decoding unit outputs a decoding result to the control unit;
step 1.7: the decoding unit does not act, or returns information of decoding error;
step 1.8: the control unit acquires the decoding result and then forwards the decoding result to the encryption and decryption unit;
step 1.9: the encryption and decryption unit performs encryption operation on the decoding result and outputs the encryption operation result to the control unit;
step 1.10: the comparison unit obtains the encryption operation result forwarded by the control unit, compares the encryption operation result with the original code value, if the encryption operation result is matched with the original code value, executes the step 1.11, and if the encryption operation result is not matched with the code value, executes the step 1.12;
step 1.11: the comparison unit returns a preset value to the control module;
step 1.12: the comparison unit returns information of the matching error to the control module;
step 1.13: after receiving the preset value, the control unit sends a decryption instruction to the encryption and decryption unit;
step 1.14: the encryption and decryption unit performs decryption operation.
The invention has the advantages that before decrypting the data ciphertext, the decoding result obtained by the encoding unit and the decoding unit is used as the verification parameter to be transmitted into the encryption and decryption unit for encryption algorithm operation, after the operation result is obtained, the comparison unit is used for verification, and after the verification is successful, the encryption and decryption unit is used for decrypting the data ciphertext, so that the loophole existing in the decryption by the main control chip is avoided, the product safety is improved, the intellectual property of a developer is protected, the encryption module has simple structure and low cost, and the popularization and the use are convenient.
In addition, in the technical scheme of the invention, the technical scheme can be realized by adopting conventional means in the field without specific description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an encryption module according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of another encryption module according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a photosensitive sensor in an encryption module according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an encryption module according to an embodiment of the present invention, with a photosensitive sensor removed from a housing.
Fig. 5 is a circuit diagram of a control unit in an encryption module according to an embodiment of the present invention.
Fig. 6 is a circuit diagram of an encryption and decryption unit in the encryption module according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of a pin connection of a control unit in an encryption module according to an embodiment of the present invention.
Fig. 8 is a flowchart of a decryption method according to another embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are illustrative of some, but not all embodiments of the invention and are not intended to limit the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that the terms "comprises" and "comprising," along with any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1:
referring to fig. 1 of the specification, an encryption module provided in one embodiment of the present invention includes an encoding unit 1, a light emitting unit 3, a light receiving unit 4, a decoding unit 6, a control unit 7, an encryption/decryption unit 8, and a comparison unit 9.
The input end of the coding unit 1 is connected with the signal output end of the control unit 7, and the coding unit 1 is used for receiving the standard code modulation output driving current sent by the control unit 7.
The input end of the light emitting unit 3 is connected with the output end of the encoding unit 1, and the light emitting unit 3 is used for outputting an optical signal under the action of a driving current.
The light receiving unit 4 is configured to receive an optical signal and convert the received optical signal into an electrical signal.
The input end of the decoding unit 6 is respectively connected with the signal output end of the control unit 7 and the output end of the light receiving unit 4, the decoding unit 6 receives the standard code sent by the control unit 7 and the electric signal converted by the light receiving unit 4, the decoding unit 6 is used for decoding the received electric signal and comparing the decoding result with the standard code, and if the decoding result is matched with the standard code, the decoding unit 6 outputs the decoding result to the control unit 7.
The control unit 7 is in communication connection with the encryption and decryption unit 8, and the control unit 7 is in communication connection with the comparison unit 9.
The encryption and decryption unit 8 is configured to obtain the decoding result sent by the control unit 7, perform encryption operation, and send the encryption operation result to the control unit 7, or perform decryption operation after receiving a decryption instruction sent by the control unit 7.
The comparing unit 9 is configured to obtain the encryption operation result and compare the encryption operation result with the original code value, and if the encryption operation result matches the original code value, return a predetermined value to the control module 7.
The control unit 7 is configured to receive the decoding result sent by the decoding unit 6, send the decoding result to the encryption and decryption unit 8 for performing encryption operation, the control unit 7 is also configured to receive the encryption operation result sent by the encryption and decryption unit 8, send the result to the comparison unit 9, and the control unit 7 is also configured to receive a predetermined value returned by the comparison unit 9, and send a decryption instruction to the encryption and decryption unit 8.
In an alternative embodiment, referring to fig. 2 of the specification, a signal amplifying unit 2 is further disposed between the coding unit 1 and the light emitting unit 3, an input end of the signal amplifying unit 2 is connected to an output end of the coding unit 1, an output end of the signal amplifying unit 2 is connected to an input end of the light emitting unit 3, and the signal amplifying unit 2 is configured to amplify a driving current output by the coding unit 1 and then supply power to the light emitting unit 3.
In an alternative embodiment, as shown in fig. 2 of the specification, a filtering unit 5 is arranged between the light receiving unit 4 and the decoding unit 6, an input end of the filtering unit 5 is connected to an output end of the light receiving unit 4, and an output end of the filtering unit 5 is connected to an input end of the decoding unit 6. Thus, the filtering unit 5 achieves the effect of filtering and denoising, and the decoding result of the decoding unit 6 is more accurate.
In an alternative embodiment, as shown in fig. 4 and fig. 3 referring to the description, the light emitting unit 3 and the light receiving unit 4 are integrated in a photosensitive sensing device, the photosensitive sensing device includes a housing 10, one side in the housing 10 is provided with the light emitting unit 3, the light emitting unit 3 is connected with a first pin 31, the first pin 31 extends to the outside of the housing 10, the opposite side of the light emitting unit 3 in the housing 10 is provided with the light receiving unit 4, the light receiving unit 4 is connected with a second pin 41, and the second pin 41 extends to the outside of the housing 10.
In an alternative embodiment, the light emitting unit 3 is a light emitting diode and the light receiving unit 4 is a photoresistor.
In an alternative embodiment, the housing 10 is a darkroom shielding housing. Thus, the interference of the external light source is avoided, and the decoding result of the decoding unit 6 is more accurate.
In an alternative embodiment, referring to fig. 5 to 7 of the specification, the control unit 7 is a chip U20A of a model STM32F103RCT6, and the encryption and decryption unit 8 is a chip U21 of a model ESPU 0808.
Specifically, the function of the coding unit 1 may be integrated in the chip U20A, and the driving current is output through the pin PC15 of the chip U20A, the photosensitive sensor is connected to the J10, the first pin 31 of the photosensitive sensor is connected to the pin PC15, and the second pin 41 of the photosensitive sensor is connected to the pin PD 2.
In an alternative embodiment, the function of the decoding unit 6 may be integrated in the chip U20A, or may be integrated in the photosensitive sensor device, and in this embodiment the decoding unit 6 is integrated in the chip U20A.
Specifically, the pin PC13 of the chip U20A is connected to the emitter of the transistor Q8, the base of the transistor Q8 is connected to the pin PC14 of the chip U20A through the resistor R102, and the collector of the transistor Q8 is connected to the I/O pin of the chip U21.
The PC12 pin of the chip U20A is connected with the emitter of the triode Q9, the base electrode of the triode Q9 is connected with the PC14 pin of the chip U20A through a resistor R104, and the collector electrode of the triode Q9 is connected with the I/O pin of the chip U21.
The RST pin and the CLK pin of chip U21 are respectively coupled to the PC10 and PC11 pins of chip U20A.
The invention has the advantages that before decrypting the data ciphertext, the decoding result obtained by the encoding unit 1 and the decoding unit 6 is used as a verification parameter to be transmitted into the encryption and decryption unit 8 for encryption algorithm operation, after the operation result is obtained, the comparison unit 9 is used for verification, after the verification is successful, the encryption and decryption unit 8 is used for decrypting the data ciphertext, thus avoiding the loopholes existing in the decryption by the main control chip, improving the safety of products, protecting the intellectual property rights of developers, and the encryption module has simple structure, low cost and convenient popularization and use.
Example 2:
referring to fig. 8 of the specification, a decryption method according to an embodiment of the present invention is applied to any one of the encryption modules in the above embodiment, and includes the following steps:
step 1.1: the coding unit acquires the standard code sent by the control unit, and outputs driving current after modulation;
step 1.2: the light emitting unit outputs a light signal under the action of a driving current;
step 1.3: the light receiving unit receives the light signal output by the light emitting unit and converts the light signal into an electric signal to be output;
step 1.4: the decoding unit acquires and decodes the electric signal output by the light receiving unit;
step 1.5: the decoding unit compares the decoding result with the standard code acquired from the control unit, if the decoding result is matched with the standard code, the step 1.6 is executed, and if the decoding result is not matched with the standard code, the step 1.7 is executed;
step 1.6: the decoding unit outputs a decoding result to the control unit;
step 1.7: the decoding unit does not act, or returns information of decoding error;
step 1.8: the control unit acquires the decoding result and then forwards the decoding result to the encryption and decryption unit;
step 1.9: the encryption and decryption unit performs encryption operation on the decoding result and outputs the encryption operation result to the control unit;
step 1.10: the comparison unit obtains the encryption operation result forwarded by the control unit, compares the encryption operation result with the original code value, if the encryption operation result is matched with the original code value, executes the step 1.11, and if the encryption operation result is not matched with the code value, executes the step 1.12;
step 1.11: the comparison unit returns a preset value to the control module;
step 1.12: the comparison unit returns information of the matching error to the control module;
step 1.13: after receiving the preset value, the control unit sends a decryption instruction to the encryption and decryption unit;
step 1.14: the encryption and decryption unit performs decryption operation.
The invention has the advantages that before decrypting the data ciphertext, the decoding result obtained by the encoding unit and the decoding unit is used as the verification parameter to be transmitted into the encryption and decryption unit for encryption algorithm operation, after the operation result is obtained, the comparison unit is used for verification, and after the verification is successful, the encryption and decryption unit is used for decrypting the data ciphertext, so that the loophole existing in the decryption by the main control chip is avoided, the product safety is improved, the intellectual property of a developer is protected, the encryption module has simple structure and low cost, and the popularization and the use are convenient.
The foregoing is only illustrative of the present invention and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., within the spirit and principles of the present invention.
Claims (8)
1. The encryption module is characterized by comprising an encoding unit, a light emitting unit, a light receiving unit, a decoding unit, a control unit, an encryption and decryption unit and a comparison unit;
the input end of the coding unit is connected with the signal output end of the control unit, and the coding unit is used for receiving the standard code modulation output driving current sent by the control unit;
the input end of the light emitting unit is connected with the output end of the coding unit, and the light emitting unit is used for outputting an optical signal under the action of driving current;
the optical receiving unit is used for receiving the optical signal and converting the received optical signal into an electric signal;
the input end of the decoding unit is respectively connected with the signal output end of the control unit and the output end of the light receiving unit, the decoding unit receives the standard code sent by the control unit and the electric signal converted by the light receiving unit, the decoding unit is used for decoding the received electric signal and comparing the decoding result with the standard code, and if the decoding result is matched with the standard code, the decoding unit outputs the decoding result to the control unit;
the control unit is in communication connection with the encryption and decryption unit and is in communication connection with the comparison unit;
the encryption and decryption unit is used for obtaining the decoding result sent by the control unit to carry out encryption operation, and sending the encryption operation result to the control unit, or carrying out decryption operation after receiving the decryption instruction sent by the control unit;
the comparing unit is used for acquiring the encryption operation result and comparing the encryption operation result with the original code value, and returning a preset value to the control module if the encryption operation result is matched with the original code value;
the control unit is used for receiving the decoding result sent by the decoding unit, sending the decoding result to the encryption and decryption unit for encryption operation, receiving the encryption operation result sent by the encryption and decryption unit, sending the encryption operation result to the comparison unit, receiving the preset value returned by the comparison unit, and sending the decryption instruction to the encryption and decryption unit.
2. The encryption module according to claim 1, wherein a signal amplifying unit is further provided between the encoding unit and the light emitting unit,
the input end of the signal amplification unit is connected with the output end of the coding unit, the output end of the signal amplification unit is connected with the input end of the light emitting unit, and the signal amplification unit is used for amplifying the driving current output by the coding unit.
3. The encryption module of claim 1, wherein the light emitting unit is a light emitting diode and the light receiving unit is a photoresistor.
4. The encryption module of claim 1, wherein the light emitting unit and the light receiving unit are integrated in a light sensitive device, the light sensitive device comprising a housing, wherein one side of the housing is provided with the light emitting unit, the light emitting unit is connected with a first pin, the first pin extends out of the housing, the opposite side of the light emitting unit in the housing is provided with the light receiving unit, the light receiving unit is connected with a second pin, and the second pin extends out of the housing.
5. The encryption module of claim 4, wherein the housing is a darkroom shielding housing.
6. The encryption module according to claim 1, wherein a filter unit is provided between the light receiving unit and the decoding unit, an input end of the filter unit is connected to an output end of the light receiving unit, and an output end of the filter unit is connected to an input end of the decoding unit.
7. The encryption module of claim 1, wherein the control unit is a chip of model STM32F103RCT6 and the encryption and decryption unit is a chip of model ESPU 0808.
8. Decryption method, applying the encryption module according to any one of claims 1-7, characterized in that it comprises the following steps:
step 1.1: the coding unit acquires the standard code sent by the control unit, and outputs driving current after modulation;
step 1.2: the light emitting unit outputs a light signal under the action of a driving current;
step 1.3: the light receiving unit receives the light signal output by the light emitting unit and converts the light signal into an electric signal to be output;
step 1.4: the decoding unit acquires and decodes the electric signal output by the light receiving unit;
step 1.5: the decoding unit compares the decoding result with the standard code acquired from the control unit, if the decoding result is matched with the standard code, the step 1.6 is executed, and if the decoding result is not matched with the standard code, the step 1.7 is executed;
step 1.6: the decoding unit outputs a decoding result to the control unit;
step 1.7: the decoding unit does not act, or returns information of decoding error;
step 1.8: the control unit acquires the decoding result and then forwards the decoding result to the encryption and decryption unit;
step 1.9: the encryption and decryption unit performs encryption operation on the decoding result and outputs the encryption operation result to the control unit;
step 1.10: the comparison unit obtains the encryption operation result forwarded by the control unit, compares the encryption operation result with the original code value, if the encryption operation result is matched with the original code value, executes the step 1.11, and if the encryption operation result is not matched with the code value, executes the step 1.12;
step 1.11: the comparison unit returns a preset value to the control module;
step 1.12: the comparison unit returns information of the matching error to the control module;
step 1.13: after receiving the preset value, the control unit sends a decryption instruction to the encryption and decryption unit;
step 1.14: the encryption and decryption unit performs decryption operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211633483.XA CN116015644A (en) | 2022-12-19 | 2022-12-19 | Encryption module and decryption method using same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211633483.XA CN116015644A (en) | 2022-12-19 | 2022-12-19 | Encryption module and decryption method using same |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116015644A true CN116015644A (en) | 2023-04-25 |
Family
ID=86027530
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211633483.XA Pending CN116015644A (en) | 2022-12-19 | 2022-12-19 | Encryption module and decryption method using same |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116015644A (en) |
-
2022
- 2022-12-19 CN CN202211633483.XA patent/CN116015644A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10333955B2 (en) | Method and system to protect software-based network-connected devices from advanced persistent threat | |
US10177816B2 (en) | Devices and methods for identification, authentication and signing purposes | |
US9717001B2 (en) | Authentication system and authentication method | |
EP1758294A1 (en) | Data communication method and system | |
US20090138709A1 (en) | Optical transceiver with vendor authentication | |
CN109271830B (en) | Fingerprint sensing integrated circuit | |
US20170109545A1 (en) | Electronic device and data verification method | |
CN116015644A (en) | Encryption module and decryption method using same | |
US9667434B2 (en) | Information transmission system and method | |
CN111093011B (en) | Optical sensor with encryption function and image data encryption method | |
JP2007226560A (en) | Ic card system | |
CN108319877B (en) | Information reading terminal using coding of external token | |
KR20180114117A (en) | Lighting Noise Reduction Circuits, Receivers and Lighting Chips | |
CN104380308A (en) | Read-in device, read-in result output method, and program | |
Zhong et al. | A visible light communication based integrated circuit for mobile payment | |
JPS5916034A (en) | Input device coupling system | |
US20230161730A1 (en) | Enhanced safety mechanism for single wire interface | |
Kim et al. | Design of an efficient image protection method based on QR code | |
US20030121977A1 (en) | Data collection system | |
KR20080068339A (en) | Infrared receiving error detecting method of cell phone | |
WO2023022535A1 (en) | Electronic device for generating mnemonic words of private key and operating method of electronic device | |
CN103368648A (en) | Visible light communication system based on time division multiple access | |
CN206574085U (en) | A kind of new encryption shield system | |
TW202228022A (en) | Encrypted hard disk device | |
CN118368099A (en) | EC chip, sealing chip, system and electronic 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 |