CN115022035A - CAN communication encryption method and device, electronic equipment and storage medium - Google Patents
CAN communication encryption method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115022035A CN115022035A CN202210617284.3A CN202210617284A CN115022035A CN 115022035 A CN115022035 A CN 115022035A CN 202210617284 A CN202210617284 A CN 202210617284A CN 115022035 A CN115022035 A CN 115022035A
- Authority
- CN
- China
- Prior art keywords
- encrypted
- message
- decrypted
- decryption
- input data
- 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
- 238000000034 method Methods 0.000 title claims abstract description 76
- 238000004891 communication Methods 0.000 title claims abstract description 37
- 238000012795 verification Methods 0.000 claims abstract description 24
- 238000004590 computer program Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 description 31
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 238000005336 cracking Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S40/00—Systems for electrical power generation, transmission, distribution or end-user application management characterised by the use of communication or information technologies, or communication or information technology specific aspects supporting them
- Y04S40/20—Information technology specific aspects, e.g. CAD, simulation, modelling, system security
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Storage Device Security (AREA)
Abstract
The embodiment of the application provides a CAN communication encryption method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: generating a CAN message; shifting the CAN message to obtain encrypted input data; obtaining encrypted data according to the encrypted input data; shifting the encrypted data to obtain an encrypted message; and sending the encrypted message to a CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result. By implementing the embodiment of the application, the safety of CAN communication CAN be improved, and the operation is simple.
Description
Technical Field
The present disclosure relates to the field of local area network security technologies, and in particular, to a method and an apparatus for encrypting CAN communication, an electronic device, and a computer-readable storage medium.
Background
The existing Controller Area Network (CAN) communication mode is basically transmitted in plaintext, which is easy to obtain related information illegally and to tamper with the related information, and is very unsafe.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for encrypting CAN communication, an electronic device, and a computer-readable storage medium, which CAN improve the security of CAN communication and are simple to operate.
In a first aspect, an embodiment of the present application provides a CAN communication encryption method, which is applied to a CAN encryption device, and the method includes:
generating a CAN message;
shifting the CAN message to obtain encrypted input data;
obtaining encrypted data according to the encrypted input data;
shifting the encrypted data to obtain an encrypted message;
and sending the encrypted message to a CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
In the implementation process, the CAN message is subjected to the shift operation, and then the encrypted data is subjected to the shift operation to obtain the encrypted message, so that the security of the obtained encrypted message is higher, the information security CAN be effectively ensured, meanwhile, the random number does not need to be generated for verification, and the operation is simple.
Further, the step of obtaining encrypted data from the encrypted input data includes:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the secret key to obtain encrypted data.
In the implementation process, the encrypted input data is encrypted according to the secret key, so that the obtained encrypted data can be encrypted and reinforced on the basis of the secret key, and the security and the accuracy are higher.
In a second aspect, an embodiment of the present application provides a CAN communication decryption method, which is applied to a CAN decryption device, and the method includes:
receiving an encrypted message which is sent from a CAN encryption device and subjected to shift operation;
shifting the encrypted message subjected to shifting operation to obtain decrypted input data;
acquiring decrypted data according to the decrypted input data;
shifting the decrypted data to obtain a decrypted message;
and verifying the decrypted message to obtain a verification result.
In the implementation process, the encrypted message is shifted, and then the decrypted data is shifted to obtain the decrypted message, so that the obtained decrypted message is higher in accuracy, can be decrypted comprehensively and accurately, ensures information safety, and is simpler and more convenient in verification process.
Further, the step of obtaining decrypted data from the decrypted input data includes:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the secret key to obtain decrypted data.
In the implementation process, the decryption input data is decrypted according to the secret key, so that the decryption process is more convenient and safer, the encryption process is not hindered, and the security and the accuracy are higher.
In a third aspect, an embodiment of the present application further provides a CAN encryption apparatus, where the apparatus includes:
the generating module is used for generating a CAN message;
the first shifting module is used for carrying out shifting operation on the CAN message to obtain encrypted input data; the encryption device is also used for carrying out shift operation on the encrypted data to obtain an encrypted message;
the encryption module is used for obtaining encrypted data according to the encrypted input data;
and the sending module is used for sending the encrypted message to a CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
In the implementation process, the CAN message is subjected to the shift operation, and then the encrypted data is subjected to the shift operation to obtain the encrypted message, so that the security of the obtained encrypted message is higher, the information security CAN be effectively ensured, meanwhile, the random number does not need to be generated for verification, and the operation is simple.
Further, the encryption module is further configured to:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the secret key to obtain encrypted data.
In the implementation process, the encrypted input data is encrypted according to the secret key, so that the obtained encrypted data can be encrypted and reinforced on the basis of the secret key, and the security and the accuracy are higher.
In a fourth aspect, an embodiment of the present application further provides a CAN decryption apparatus, where the apparatus includes:
the receiving module is used for receiving and sending a self-encryption message of the CAN encryption device;
the second shifting module is used for shifting the encrypted message to obtain decrypted input data; the decryption module is also used for carrying out shift operation on the decryption data to obtain a decryption message;
the decryption module is used for obtaining decrypted data according to the decrypted input data;
and the verification module is used for verifying the decrypted message to obtain a verification result.
In the implementation process, the encrypted message is shifted, and then the decrypted data is shifted to obtain the decrypted message, so that the obtained decrypted message is higher in accuracy, can be decrypted comprehensively and accurately, ensures information safety, and is simpler and more convenient in verification process.
Further, the decryption module is further configured to:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the secret key to obtain decrypted data.
In the implementation process, the decryption input data is decrypted according to the secret key, so that the decryption process is more convenient and safer, the encryption process is not hindered, and the security and the accuracy are higher.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any of the first aspect when executing the computer program.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, having stored thereon instructions, which, when executed on a computer, cause the computer to perform the method according to any one of the first aspect.
In a seventh aspect, an embodiment of the present application provides a computer program product, which when run on a computer, causes the computer to execute the method according to any one of the first aspect.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
The present invention can be implemented in accordance with the teachings of the specification, which is to be read in conjunction with the following detailed description of the presently preferred embodiments of the invention.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flow chart of a CAN communication encryption method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of another CAN communication decryption method according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a CAN encryption device provided in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a CAN decryption device according to an embodiment of the present application;
fig. 5 is a schematic structural component diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The following detailed description of embodiments of the present application will be described in conjunction with the accompanying drawings and examples. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
Example one
Fig. 1 is a schematic flowchart of a CAN communication encryption method provided in an embodiment of the present application, and as shown in fig. 1, the method includes:
s1, generating a CAN message;
s2, carrying out displacement operation on the CAN message to obtain encrypted input data;
s3, obtaining encrypted data from the encrypted input data;
s4, shifting the encrypted data to obtain an encrypted message;
and S5, sending the encrypted message to the CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
In the implementation process, the CAN message is subjected to the shift operation, and then the encrypted data is subjected to the shift operation to obtain the encrypted message, so that the security of the obtained encrypted message is higher, the information security CAN be effectively ensured, meanwhile, the random number does not need to be generated for verification, and the operation is simple.
Optionally, the embodiment of the present application may perform encryption and decryption based on the XTEA algorithm, where the first 7 bytes of the CAN message are used as application data, and the last byte is used as check data. And carrying out shift operation on the CAN message carrying the check data to obtain encrypted input data, wherein the encrypted input data is used as the input of the XTEA algorithm.
Further, S3 includes:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the secret key to obtain encrypted data.
In the implementation process, the encrypted input data is encrypted according to the secret key, so that the obtained encrypted data can be encrypted and reinforced on the basis of the secret key, and the security and the accuracy are higher.
Illustratively, four keys of the XTEA algorithm need to be set, and are all private keys, which cannot be sent out, so that the encryption security can be effectively ensured, and the encryption can be prevented from being obtained illegally.
Optionally, the encrypted message in the embodiment of the present application is sent to the CAN decryption device through the CAN bus.
Example two
Fig. 2 is a schematic flowchart of a CAN communication decryption method provided in an embodiment of the present application, and as shown in fig. 2, the method includes:
s1, receiving the encrypted message which is sent from the CAN encryption device and is subjected to the shift operation;
s2, shifting the encrypted message after shifting operation to obtain decrypted input data;
s3, obtaining the decrypted data according to the decrypted input data;
s4, shifting the decrypted data to obtain a decrypted message;
and S5, verifying the decrypted message to obtain a verification result.
In the implementation process, the encrypted message is shifted, and then the decrypted data is shifted to obtain the decrypted message, so that the obtained decrypted message is higher in accuracy, can be decrypted comprehensively and accurately, ensures information safety, and is simpler and more convenient in verification process.
Further, S3 includes:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the secret key to obtain decrypted data.
In the implementation process, the decryption input data is decrypted according to the secret key, so that the decryption process is more convenient and safer, the encryption process is not hindered, and the security and the accuracy are higher.
Optionally, the decrypted message is verified, and if the verification is passed, the decrypted message is determined to be valid, and if the verification fails, the decrypted message is determined to be invalid.
According to the embodiment of the application, the CAN message CAN be effectively prevented from being read directly if an illegal way is available for reading the CAN message from the CAN bus. And brute force cracking can be prevented. If an illegal way wants to crack the obtained CAN message violently by means of a key table and the like, due to the high coupling characteristic of the operation of the key, the encrypted data and the decrypted data in the XTEA algorithm, the cracking cannot be performed.
Because the last data of the decrypted message is the check data, once the decrypted message is tampered, the data obtained after decryption by the XTEA algorithm fails to be checked and can be identified as invalid data, and the data can be effectively prevented from being tampered.
The communication encryption method of the embodiment of the present application is not limited to CAN communication, and for example, UART communication, SPI communication, and the like may also be used in this manner, and may also be used in other industrial fields.
Optionally, the decryption apparatus according to the embodiment of the present application receives, through the CAN bus, the encrypted message that is sent from the CAN encryption apparatus and that has undergone the shift operation.
EXAMPLE III
In order to implement the method corresponding to the above-mentioned embodiment to achieve the corresponding functions and technical effects, the following provides a CAN encryption apparatus, as shown in fig. 3, the apparatus including:
the generating module 1 is used for generating a CAN message;
the first shifting module 2 is used for performing shifting operation on the CAN message to obtain encrypted input data; the device is also used for carrying out shift operation on the encrypted data to obtain an encrypted message;
the encryption module 3 is used for obtaining encrypted data according to the encrypted input data;
and the sending module 4 is used for sending the encrypted message to the CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
In the implementation process, the CAN message is subjected to the shift operation, and then the encrypted data is subjected to the shift operation to obtain the encrypted message, so that the security of the obtained encrypted message is higher, the information security CAN be effectively ensured, meanwhile, the random number does not need to be generated for verification, and the operation is simple.
Further, the encryption module 3 is further configured to:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the secret key to obtain encrypted data.
In the implementation process, the encrypted input data is encrypted according to the secret key, so that the obtained encrypted data can be encrypted and reinforced on the basis of the secret key, and the security and the accuracy are higher.
The CAN encryption device CAN implement the method of the first embodiment. The alternatives in the first embodiment are also applicable to the present embodiment, and are not described in detail here.
The rest of the embodiments of the present application may refer to the contents of the first embodiment, and in this embodiment, details are not repeated.
Example four
In order to execute the corresponding method of the above embodiment to achieve the corresponding functions and technical effects, the following provides a CAN decryption apparatus, as shown in fig. 4, the apparatus including:
the receiving module 5 is used for receiving and sending a self-encryption message of the CAN encryption device;
the second shifting module 6 is used for shifting the encrypted message to obtain decrypted input data; the device is also used for carrying out shift operation on the decrypted data to obtain a decrypted message;
the decryption module 7 is used for obtaining decrypted data according to the decrypted input data;
and the checking module 8 is used for checking the decrypted message to obtain a checking result.
In the implementation process, the encrypted message is shifted, and then the decrypted data is shifted to obtain the decrypted message, so that the obtained decrypted message is higher in accuracy, can be decrypted comprehensively and accurately, ensures information safety, and is simpler and more convenient in verification process.
Further, the decryption module 7 is further configured to:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the key to obtain decrypted data.
In the implementation process, the decryption input data is decrypted according to the secret key, so that the decryption process is more convenient and safer, the encryption process is not obstructed, and the security and the accuracy are higher.
The CAN decryption apparatus CAN implement the method of the second embodiment. The options in the second embodiment are also applicable to the present embodiment, and are not described in detail here.
The rest of the embodiments of the present application may refer to the contents of the second embodiment, and in this embodiment, details are not repeated.
EXAMPLE five
The embodiment of the application provides an electronic device, which comprises a memory and a processor, wherein the memory is used for storing a computer program, and the processor runs the computer program to enable the electronic device to execute the CAN communication encryption method in the first embodiment and the CAN communication decryption method in the second embodiment.
Alternatively, the electronic device may be a server.
Referring to fig. 5, fig. 5 is a schematic structural component diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may include a processor 51, a communication interface 52, a memory 53 and at least one communication bus 54. Wherein the communication bus 54 is used for realizing direct connection communication of these components. The communication interface 52 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The processor 51 may be an integrated circuit chip having signal processing capabilities.
The Processor 51 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 51 may be any conventional processor or the like.
The Memory 53 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 53 has stored therein computer readable instructions which, when executed by the processor 51, enable the apparatus to perform the various steps involved in the method embodiment of fig. 1 described above.
Optionally, the electronic device may further include a memory controller, an input output unit. The memory 53, the memory controller, the processor 51, the peripheral interface, and the input/output unit are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses 54. The processor 51 is adapted to execute executable modules stored in the memory 53, such as software functional modules or computer programs comprised by the device.
The input and output unit is used for providing a task for a user and starting an optional time interval or preset execution time for the task creation so as to realize the interaction between the user and the server. The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
It will be appreciated that the configuration shown in fig. 5 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 5 or have a different configuration than shown in fig. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the CAN communication encryption method of the first embodiment and the CAN communication decryption method of the second embodiment.
Embodiments of the present application further provide a computer program product, which when running on a computer, causes the computer to execute the method described in the method embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A CAN communication encryption method is applied to a CAN encryption device and is characterized by comprising the following steps:
generating a CAN message;
shifting the CAN message to obtain encrypted input data;
obtaining encrypted data according to the encrypted input data;
shifting the encrypted data to obtain an encrypted message;
and sending the encrypted message to a CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
2. The CAN communication encryption method of claim 1, wherein the step of obtaining encrypted data from the encrypted input data comprises:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the key to obtain encrypted data.
3. A CAN communication decryption method is applied to a CAN decryption device, and is characterized by comprising the following steps:
receiving an encrypted message which is sent from a CAN encryption device and is subjected to shift operation;
shifting the encrypted message subjected to shifting operation to obtain decrypted input data;
obtaining decrypted data according to the decrypted input data;
shifting the decrypted data to obtain a decrypted message;
and verifying the decrypted message to obtain a verification result.
4. The CAN communication encryption method of claim 3, wherein the step of obtaining decrypted data from the decrypted input data comprises:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the secret key to obtain decrypted data.
5. A CAN encryption apparatus, the apparatus comprising:
the generating module is used for generating a CAN message;
the first shifting module is used for carrying out shifting operation on the CAN message to obtain encrypted input data; the encryption device is also used for carrying out shift operation on the encrypted data to obtain an encrypted message;
the encryption module is used for obtaining encrypted data according to the encrypted input data;
and the sending module is used for sending the encrypted message to a CAN decryption device so that the CAN decryption device verifies the encrypted message to obtain a verification result.
6. The CAN communication encryption apparatus of claim 5, wherein the encryption module is further configured to:
acquiring a secret key;
and carrying out encryption operation on the encrypted input data according to the secret key to obtain encrypted data.
7. A CAN decryption apparatus, the apparatus comprising:
the receiving module is used for receiving and sending a self-encryption message of the CAN encryption device;
the second shifting module is used for shifting the encrypted message to obtain decrypted input data; the decryption module is also used for carrying out shift operation on the decryption data to obtain a decryption message;
the decryption module is used for obtaining decrypted data according to the decrypted input data;
and the verification module is used for verifying the decrypted message to obtain a verification result.
8. The CAN communication encryption apparatus of claim 7, wherein the decryption module is further configured to:
acquiring a secret key;
and carrying out decryption operation on the decrypted input data according to the key to obtain decrypted data.
9. An electronic device, comprising a memory for storing a computer program and a processor that runs the computer program to cause the electronic device to perform the CAN communication encryption method according to any one of claims 1 to 4.
10. A computer-readable storage medium characterized in that it stores a computer program which, when executed by a processor, implements the CAN communication encryption method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210617284.3A CN115022035A (en) | 2022-06-01 | 2022-06-01 | CAN communication encryption method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210617284.3A CN115022035A (en) | 2022-06-01 | 2022-06-01 | CAN communication encryption method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115022035A true CN115022035A (en) | 2022-09-06 |
Family
ID=83073601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210617284.3A Pending CN115022035A (en) | 2022-06-01 | 2022-06-01 | CAN communication encryption method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115022035A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115643101A (en) * | 2022-10-31 | 2023-01-24 | 重庆长安汽车股份有限公司 | Encryption transmission method and device of communication data, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108011708A (en) * | 2016-10-28 | 2018-05-08 | 长城汽车股份有限公司 | The controller and vehicle of message encryption method, vehicle based on automobile bus |
CN110336662A (en) * | 2019-06-06 | 2019-10-15 | 平安科技(深圳)有限公司 | Digital information encryption method, device, computer equipment and storage medium |
CN111245808A (en) * | 2020-01-07 | 2020-06-05 | 深圳壹账通智能科技有限公司 | Data encryption and decryption method and device and computer equipment |
CN113612799A (en) * | 2021-08-25 | 2021-11-05 | 中国银行股份有限公司 | Block chain hash encryption method and device based on SM2 algorithm |
US20210352052A1 (en) * | 2020-05-08 | 2021-11-11 | Shnaghai Hode Information & Finance Co., Ltd. | Encryption and decryption method and server of digital coding, and storage medium |
CN114070552A (en) * | 2021-10-28 | 2022-02-18 | 国核自仪***工程有限公司 | Data encryption method and device, data decryption method and device, equipment and medium |
-
2022
- 2022-06-01 CN CN202210617284.3A patent/CN115022035A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108011708A (en) * | 2016-10-28 | 2018-05-08 | 长城汽车股份有限公司 | The controller and vehicle of message encryption method, vehicle based on automobile bus |
CN110336662A (en) * | 2019-06-06 | 2019-10-15 | 平安科技(深圳)有限公司 | Digital information encryption method, device, computer equipment and storage medium |
CN111245808A (en) * | 2020-01-07 | 2020-06-05 | 深圳壹账通智能科技有限公司 | Data encryption and decryption method and device and computer equipment |
US20210352052A1 (en) * | 2020-05-08 | 2021-11-11 | Shnaghai Hode Information & Finance Co., Ltd. | Encryption and decryption method and server of digital coding, and storage medium |
CN113612799A (en) * | 2021-08-25 | 2021-11-05 | 中国银行股份有限公司 | Block chain hash encryption method and device based on SM2 algorithm |
CN114070552A (en) * | 2021-10-28 | 2022-02-18 | 国核自仪***工程有限公司 | Data encryption method and device, data decryption method and device, equipment and medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115643101A (en) * | 2022-10-31 | 2023-01-24 | 重庆长安汽车股份有限公司 | Encryption transmission method and device of communication data, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110493197B (en) | Login processing method and related equipment | |
TWI557589B (en) | Secure software product identifier for product validation and activation | |
CN110519309B (en) | Data transmission method, device, terminal, server and storage medium | |
CN102419804B (en) | Reliable software product confirmation and activation with redundancy security | |
JP6740545B2 (en) | Information processing device, verification device, information processing system, information processing method, and program | |
CN110995720B (en) | Encryption method, device, host terminal and encryption chip | |
US8774407B2 (en) | System and method for executing encrypted binaries in a cryptographic processor | |
CN111161056A (en) | Method, system and equipment for improving transaction security of digital assets | |
CN114244522A (en) | Information protection method and device, electronic equipment and computer readable storage medium | |
CN115022035A (en) | CAN communication encryption method and device, electronic equipment and storage medium | |
CN112307503B (en) | Signature management method and device and electronic equipment | |
CN110708155B (en) | Copyright information protection method, copyright information protection system, copyright confirming method, copyright confirming device, copyright confirming equipment and copyright confirming medium | |
JP2007181011A (en) | Data sharing device | |
CN108376212B (en) | Execution code security protection method and device and electronic device | |
CS Machado et al. | Software control and intellectual property protection in cyber-physical systems | |
JP2008035019A (en) | Digital signature device | |
JP6631989B2 (en) | Encryption device, control method, and program | |
CN112087295A (en) | Encryption and decryption method and device for electronic lock, electronic lock and storage medium | |
CN112016055A (en) | Software authorized activation code generation method and system based on hardware characteristics | |
CN114584314B (en) | Registration method, device, equipment and medium | |
CN106919846B (en) | Message middleware processing method and system | |
JP2007157021A (en) | System for distributing tamper resistance authentication portable program and method therefor | |
CN113508380A (en) | Method for terminal entity authentication | |
CN116912985B (en) | Door lock control method, device, system, equipment and medium based on dynamic password | |
CN116743388A (en) | Signature encryption method and device, electronic equipment and storage medium |
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 |