CN114915471B - Dynamic table lookup based serial port encryption transmission method and system - Google Patents

Dynamic table lookup based serial port encryption transmission method and system Download PDF

Info

Publication number
CN114915471B
CN114915471B CN202210535257.1A CN202210535257A CN114915471B CN 114915471 B CN114915471 B CN 114915471B CN 202210535257 A CN202210535257 A CN 202210535257A CN 114915471 B CN114915471 B CN 114915471B
Authority
CN
China
Prior art keywords
offset
mapping table
master
slave device
slave
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
CN202210535257.1A
Other languages
Chinese (zh)
Other versions
CN114915471A (en
Inventor
杨峰
唐天生
谯加林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xicheng Micro Electronics Co ltd
Original Assignee
Shenzhen Xicheng Micro Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Xicheng Micro Electronics Co ltd filed Critical Shenzhen Xicheng Micro Electronics Co ltd
Priority to CN202210535257.1A priority Critical patent/CN114915471B/en
Publication of CN114915471A publication Critical patent/CN114915471A/en
Application granted granted Critical
Publication of CN114915471B publication Critical patent/CN114915471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The application discloses a serial port encryption transmission method based on dynamic table lookup, which comprises the following steps: the master device randomly generates a first offset, encrypts the first offset through an original mapping table and then sends the encrypted first offset to the slave device, and after a first handshake instruction is sent, the original mapping table is updated by using the first offset to obtain a first mapping table; after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table with the first offset to obtain a first mapping table, randomly generates a second offset to encrypt the second offset, and sends the encrypted second offset to the master device, and the slave device updates the first mapping table with the second offset to obtain a second mapping table; the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table; the master-slave device uses the second mapping table for encrypted communication. The method has strong encryption effect and is not easy to crack.

Description

Dynamic table lookup based serial port encryption transmission method and system
Technical Field
The application relates to the technical field of encryption, in particular to a serial port encryption transmission method and system based on dynamic table lookup.
Background
Along with the progress of science and technology and the popularization of the internet of things, people's life is increasingly electronic and digital, and a large amount of data transmission is involved. People pay more and more attention to privacy, and development of digital encryption technology is promoted.
Conventional encryption algorithms (such as DES, RSA, SHA, AES, ECC) have high encryption strength, but require large calculation amount, and are not suitable for application scenarios of low-end processors.
Disclosure of Invention
Aiming at the defects in the prior art, the application provides a serial port encryption transmission method and a serial port encryption transmission system based on dynamic table lookup, and each transmission is realized by randomly generating offset by master equipment and slave equipment, so that the serial port encryption transmission method and system have stronger encryption effect and are not easy to crack.
In a first aspect, a serial port encryption transmission method based on dynamic table lookup provided by an embodiment of the present application includes the following steps:
the method comprises the steps that the same original mapping table is stored in master equipment and slave equipment, when the master equipment and the slave equipment carry out data communication, the master equipment randomly generates a first offset and stores the first offset in the master equipment, the first offset is encrypted through the stored original mapping table and then sent to the slave equipment through a handshake instruction, and after the master equipment sends a first handshake instruction, the original mapping table is updated through the first offset to obtain a first mapping table;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
Optionally, the value range of the first offset is 0 to xfff.
Optionally, the value range of the second offset is 0-255.
In a second aspect, the serial port encryption transmission system based on dynamic table lookup provided by the application comprises a master device and a slave device, wherein the same original mapping table is stored in the master device and the slave device;
when the master device and the slave device carry out data communication, the master device randomly generates a first offset and stores the first offset in the master device, encrypts the first offset through a stored original mapping table and then sends the first offset to the slave device through a handshake instruction, and after the master device sends the first handshake instruction, the master device updates the original mapping table through the first offset to obtain a first mapping table;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
Optionally, the value range of the first offset is 0 to xfff.
Optionally, the value range of the second offset is 0-255.
The application has the beneficial effects that:
according to the serial port encryption transmission method based on the dynamic table lookup, the offset is randomly generated by the master-slave equipment respectively in each transmission, so that the serial port encryption transmission method based on the dynamic table lookup has a strong encryption effect and is not easy to crack. Meanwhile, only table look-up operation is needed in the encryption process, so that the method has the advantage of small calculation amount and can be widely applied.
The serial port encryption transmission system based on the dynamic table lookup provided by the embodiment of the application has stronger encryption effect and is not easy to crack because the offset is randomly generated by the master equipment and the slave equipment respectively in each transmission. Meanwhile, only table look-up operation is needed in the encryption process, so that the method has the advantage of small calculation amount and can be widely applied.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. Like elements or portions are generally identified by like reference numerals throughout the several figures. In the drawings, elements or portions thereof are not necessarily drawn to scale.
Fig. 1 shows a flowchart of a serial port encryption transmission method based on dynamic table lookup according to a first embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs.
Example 1
As shown in fig. 1, a flowchart of a serial port encryption transmission method based on dynamic table lookup according to a first embodiment of the present application is shown, and the method includes the following steps:
the method comprises the steps that the same original mapping table is stored in master equipment and slave equipment, when the master equipment and the slave equipment carry out data communication, the master equipment randomly generates a first offset and stores the first offset in the master equipment, the first offset is encrypted through the stored original mapping table and then sent to the slave equipment through a handshake instruction, and after the master equipment sends a first handshake instruction, the original mapping table is updated through the first offset to obtain a first mapping table; wherein the value range of the first offset is 0-xfff; the serial port transmission data are transmitted by taking bytes as basic units, and the main equipment encrypts each byte to be transmitted in an original mapping table;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table; wherein the value range of the second offset is 0-255;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
The above embodiments are further described below using specific examples.
The original mapping tables {0x03,0x04,0x05,0x55,0xa, 0x01,0x02} in the master device, if the master device generates the first offset of 2, the master device generates the first mapping table {0x01,0x02,0x03, 0xa, 0x01,0x02} according to the first offsets 0x02 and {0x03,0x 05,0x55,0xa, 0x02, the master device generates the handshake protocol content to be transmitted is 0x55 0xaa 0x01 0x02, wherein 0x02 is the first offset, the master device substantially transmits content 0x03 0x04 0x050x06 after encrypting the master device, the slave device receives 3 4 5 6, then obtains 0x55 0xaa 0x01 0x02 according to {0x03,0x04,0x05,0x55,0xa, 0x01,0x02} according to 0x55 0xaa 0x01 0x02, and obtains the first offset 0x02, and the slave device generates the first mapping table {0x 02,0x 04,0x05,0x55,0x 02 and 0x02 {0x 04,0x 01,0x 02. If the slave device randomly generates the second offset 1, the slave device generates a second mapping table from the second offset 0x01 and the first mapping table {0x01,0x02,0x03,0x04,0x05,0x55,0xaa }: {0xaa,0x01,0x02,0x03,0x04,0x05,0x55}. The handshake protocol content that the slave needs to send is 0x55 0xaa 0x01 0x01, where 0x01 is the second offset, and the slave substantially sends content 0x050x06 0x01 0x01 after encrypting with the original mapping table. The master device receives 0x050x06 0x01 0x01, analyzes the data according to the first mapping table to obtain 0x55 0xaa 0x01 0x01, obtains a second offset 0x01 according to 0x55 0xaa 0x01 0x02, and generates a second mapping table {0xa, 0x01,0x02,0x03,0x04,0x05,0x55,0xa } according to the second offset 0x01 and the first mapping table {0x01,0x02,0x03,0x04,0x05,0x55 }. And the master device and the slave device carry out encryption communication through the generated second mapping table.
According to the serial port encryption transmission method based on the dynamic table lookup, as the offset is randomly generated by the master-slave equipment respectively in each transmission, the serial port encryption transmission method has a strong encryption effect and is not easy to crack. Meanwhile, only table look-up operation is needed in the encryption process, so that the method has the advantage of small calculation amount and can be widely applied.
Example 2
Another embodiment of the present application provides a serial port encryption transmission system based on dynamic table lookup, the system includes: the master device and the slave device store the same original mapping table in the master device and the slave device;
when the master device and the slave device carry out data communication, the master device randomly generates a first offset and stores the first offset in the master device, the first offset is encrypted through a stored original mapping table and then is sent to the slave device through a handshake instruction, after the master device sends the first handshake instruction, the original mapping table is updated by using the first offset to obtain the first mapping table, and the value range of the first offset is 0-xfff;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table, wherein the value range of the second offset is 0-255;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
The above embodiments are further described below using specific examples.
The original mapping tables {0x03,0x04,0x05,0x55,0xa, 0x01,0x02} in the master device, if the master device generates the first offset of 2, the master device generates the first mapping table {0x01,0x02,0x03, 0xa, 0x01,0x02} according to the first offsets 0x02 and {0x03,0x 05,0x55,0xa, 0x02, the master device generates the handshake protocol content to be transmitted is 0x55 0xaa 0x01 0x02, wherein 0x02 is the first offset, the master device substantially transmits content 0x03 0x04 0x050x06 after encrypting the master device, the slave device receives 3 4 5 6, then obtains 0x55 0xaa 0x01 0x02 according to {0x03,0x04,0x05,0x55,0xa, 0x01,0x02} according to 0x55 0xaa 0x01 0x02, and obtains the first offset 0x02, and the slave device generates the first mapping table {0x 02,0x 04,0x05,0x55,0x 02 and 0x02 {0x 04,0x 01,0x 02. If the slave device randomly generates the second offset 1, the slave device generates a second mapping table from the second offset 0x01 and the first mapping table {0x01,0x02,0x03,0x04,0x05,0x55,0xaa }: {0xaa,0x01,0x02,0x03,0x04,0x05,0x55}. The handshake protocol content that the slave needs to send is 0x55 0xaa 0x01 0x01, where 0x01 is the second offset, and the slave substantially sends content 0x050x06 0x01 0x01 after encrypting with the original mapping table. The master device receives 0x050x06 0x01 0x01, analyzes the data according to the first mapping table to obtain 0x55 0xaa 0x01 0x01, obtains a second offset 0x01 according to 0x55 0xaa 0x01 0x02, and generates a second mapping table {0xa, 0x01,0x02,0x03,0x04,0x05,0x55,0xa } according to the second offset 0x01 and the first mapping table {0x01,0x02,0x03,0x04,0x05,0x55 }. And the master device and the slave device carry out encryption communication through the generated second mapping table.
According to the serial port encryption transmission system based on the dynamic table lookup, the offset is randomly generated by the master-slave equipment respectively in each data transmission, so that the serial port encryption transmission system has a strong encryption effect and is not easy to crack. Meanwhile, only table look-up operation is needed in the encryption process, so that the method has the advantage of small calculation amount and can be widely applied.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application 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 scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application, and are intended to be included within the scope of the appended claims and description.

Claims (6)

1. The serial port encryption transmission method based on dynamic table lookup is characterized by comprising the following steps:
the method comprises the steps that the same original mapping table is stored in master equipment and slave equipment, when the master equipment and the slave equipment carry out data communication, the master equipment randomly generates a first offset and stores the first offset in the master equipment, the first offset is encrypted through the stored original mapping table and then sent to the slave equipment through a handshake instruction, and after the master equipment sends a first handshake instruction, the original mapping table is updated through the first offset to obtain a first mapping table;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
2. The method of claim 1, wherein the first offset has a value in the range of 0 xfff.
3. The method of claim 1, wherein the second offset has a value in the range of 0 to 255.
4. The serial port encryption transmission system based on the dynamic table lookup is characterized by comprising a master device and a slave device, wherein the master device and the slave device store the same original mapping table;
when the master device and the slave device carry out data communication, the master device randomly generates a first offset and stores the first offset in the master device, encrypts the first offset through a stored original mapping table and then sends the first offset to the slave device through a handshake instruction, and after the master device sends the first handshake instruction, the master device updates the original mapping table through the first offset to obtain a first mapping table;
after receiving the first handshake instruction, the slave device analyzes the stored original mapping table to obtain a first offset, updates the original mapping table by using the first offset to obtain a first mapping table, randomly generates a second offset by using the slave device, encrypts the second offset by using the obtained first mapping table, and then sends the encrypted second offset to the master device by the handshake instruction, and the slave device updates the first mapping table by using the second offset to obtain a second mapping table;
the master device receives a handshake instruction of the slave device, analyzes the handshake instruction by using the stored first mapping table to obtain a second offset, and updates the first mapping table by using the second offset to obtain a second mapping table;
the master-slave device uses the second mapping table for encrypted communication.
5. The system of claim 4, wherein the first offset has a value in the range of 0 xfff.
6. The system of claim 4, wherein the second offset has a value in the range of 0 to 255.
CN202210535257.1A 2022-05-17 2022-05-17 Dynamic table lookup based serial port encryption transmission method and system Active CN114915471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210535257.1A CN114915471B (en) 2022-05-17 2022-05-17 Dynamic table lookup based serial port encryption transmission method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210535257.1A CN114915471B (en) 2022-05-17 2022-05-17 Dynamic table lookup based serial port encryption transmission method and system

Publications (2)

Publication Number Publication Date
CN114915471A CN114915471A (en) 2022-08-16
CN114915471B true CN114915471B (en) 2023-11-24

Family

ID=82768371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210535257.1A Active CN114915471B (en) 2022-05-17 2022-05-17 Dynamic table lookup based serial port encryption transmission method and system

Country Status (1)

Country Link
CN (1) CN114915471B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015004743A (en) * 2013-06-19 2015-01-08 大日本印刷株式会社 Encryption processing device and information processing apparatus
CN109041031A (en) * 2018-08-30 2018-12-18 北京轩辕联科技有限公司 Bluetooth automatic matching method, apparatus, mobile unit and vehicle

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11868318B1 (en) * 2019-12-06 2024-01-09 Pure Storage, Inc. End-to-end encryption in a storage system with multi-tenancy

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015004743A (en) * 2013-06-19 2015-01-08 大日本印刷株式会社 Encryption processing device and information processing apparatus
CN109041031A (en) * 2018-08-30 2018-12-18 北京轩辕联科技有限公司 Bluetooth automatic matching method, apparatus, mobile unit and vehicle

Also Published As

Publication number Publication date
CN114915471A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
Callas et al. OpenPGP message format
JP6685230B2 (en) Method and apparatus for providing extended object notation data
US20180349169A1 (en) File Transfer Using Standard Blocks and Standard-Block Identifiers
JP5205075B2 (en) Encryption processing method, encryption processing device, decryption processing method, and decryption processing device
US8271777B2 (en) Secure host connection
US8375211B2 (en) Optimization of signing soap body element
US20200084283A1 (en) Session Resumption Method and Apparatus, and Computer Storage Medium
CN101163001A (en) Electronic seal production system and method
CN114915471B (en) Dynamic table lookup based serial port encryption transmission method and system
WO2016155495A1 (en) Data exchange method, apparatus and device
CN110581838B (en) Method for continuously requesting data stream, electronic device and computer equipment
CN106411501A (en) Method and system for generating permission token and equipment
EP1418700A1 (en) Method and device for communicating encrypted asynchronous and synchronous packets
JP2013078019A (en) Communication device, reception control method and transmission control method
KR101554760B1 (en) Network message transformation device and methods thereof
US11082411B2 (en) RDMA-based data transmission method, network interface card, server and medium
JP3988475B2 (en) Transmitting apparatus, receiving apparatus and methods thereof
CN107370731B (en) Method and device for realizing communication between different applications based on natural language
CN112118202B (en) Base station data modulation method and device
JP2010232745A (en) System and method for transmission and reception of encryption electronic mail
CN107395583A (en) The method and device to be communicated between different application is realized based on natural language
CN107193510B (en) Parameter setting method and system for image forming apparatus
US10530570B2 (en) Transmission apparatus, and transmission data protection method thereof
JP2006524950A (en) Overhead reduction and address protection in the communication stack
JP6591294B2 (en) IDENTIFICATION INFORMATION GENERATION DEVICE, IDENTIFICATION INFORMATION GENERATION METHOD, AND IDENTIFICATION INFORMATION GENERATION PROGRAM

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