CN112188485A - Encryption and decryption method based on Bluetooth communication - Google Patents

Encryption and decryption method based on Bluetooth communication Download PDF

Info

Publication number
CN112188485A
CN112188485A CN202011004619.1A CN202011004619A CN112188485A CN 112188485 A CN112188485 A CN 112188485A CN 202011004619 A CN202011004619 A CN 202011004619A CN 112188485 A CN112188485 A CN 112188485A
Authority
CN
China
Prior art keywords
data
encryption
random number
decryption
bluetooth communication
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
Application number
CN202011004619.1A
Other languages
Chinese (zh)
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN202011004619.1A priority Critical patent/CN112188485A/en
Publication of CN112188485A publication Critical patent/CN112188485A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an encryption and decryption method based on Bluetooth communication, which connects devices through a Bluetooth protocol; when data transmission is needed, the equipment A generates a random number; the device A acquires a corresponding encryption key and a data discrete table through a random number; carrying out symmetric encryption on plaintext data through a secret key, and carrying out discrete processing to obtain ciphertext data; the device A encapsulates the ciphertext data and the generated random number into a data packet and sends the data packet to the device B; the device B extracts a random number from the data packet, and acquires a decryption key and a data discrete table corresponding to the random number; and carrying out data reduction and symmetric decryption on the ciphertext data according to the discrete table to obtain plaintext data. The invention does not need to increase hardware design and expenditure, generates the random number by using the current time, and can adjust the mapping relation between the key and the data discrete table and the random number, thereby saving encryption time and improving the confidentiality and the safety of the Bluetooth communication equipment.

Description

Encryption and decryption method based on Bluetooth communication
Technical Field
The invention relates to the technical field of communication, in particular to an encryption and decryption method based on Bluetooth communication.
Background
Bluetooth communication is a low-power consumption and low-cost technology, and is widely applied to the industries of smart phones and smart home appliances. Because the Bluetooth communication belongs to wireless communication, communication data is easy to eavesdrop, if a third party obtains login information, a forged instruction can be sent to carry out malicious takeover and control on equipment, the safety of personnel and the equipment is damaged, the existing encryption method generally adopts a single encryption method and a secret key, the encryption method is easy to crack, and the safety degree is low.
Disclosure of Invention
In order to solve the problems in the prior art, the invention aims to provide a Bluetooth communication encryption and decryption method which is easy to implement and occupies less resources, and the confidentiality and the safety of Bluetooth communication equipment are improved.
In order to achieve the purpose, the invention adopts the technical scheme that:
an encryption and decryption method based on Bluetooth communication comprises the following steps:
step S1, carrying out pairing connection on the device A and the device B through a Bluetooth protocol;
step S2, when data transmission is needed, the device A generates a random number;
step S3, the device A maps and searches from the storage area through the random number, and obtains the encryption key and the data discrete table corresponding to the random number;
step S4, carrying out symmetric encryption on plaintext data through the secret key, and then carrying out discrete processing on the encrypted data to obtain ciphertext data;
step S5, the device A encapsulates the ciphertext data and the generated random number into a data packet and sends the data packet to the device B;
step S6, the device B receives the data packet, extracts the random number from the data packet, and obtains the decryption key and the data discrete table corresponding to the random number from the storage area of the device B;
and S7, the device B restores the data of the ciphertext according to the discrete table, and symmetrically decrypts the ciphertext according to the decryption key to obtain plaintext data.
Further, the method for generating the random number in step S2 is as follows: the device A generates a random number by the current time, the device U ID number or the coordinate parameter.
Further, the encryption and decryption keys and the data discrete table are written into a storage space of the device in advance.
Further, the mapping relation between the random number, the encryption and decryption keys and the data discrete table is synchronously changed in the equipment.
Further, the method for changing the mapping relationship comprises the following steps: the device A initiates a request for changing the encryption mapping relation to the device B at regular time, proposes a new mapping relation X, and synchronously changes the mapping relation between the device A and the device B into X in a three-handshake interaction mode.
Further, in step S4, the method further includes dividing the plaintext data into a plurality of data segments with fixed bytes, and then performing symmetric encryption and discretization on the data segments to obtain a plurality of pieces of ciphertext data.
Further, the symmetric encryption adopts one of exclusive-or encryption, DES encryption, AES encryption or data discrete encryption.
The invention has the beneficial effects that: according to the encryption and decryption method based on Bluetooth communication, hardware design and expenditure do not need to be increased, the random number is generated by using the current time, time consumption of encryption is saved by using the time discreteness, and the confidentiality of the encryption and decryption process is improved. And the key and the data discrete table can be changed with the mapping relation of the random number at any time, thereby improving the confidentiality and the safety of the Bluetooth communication equipment and further meeting the use requirements of users.
Drawings
Fig. 1 is a flowchart of an encryption method based on bluetooth communication according to an embodiment of the present invention.
Fig. 2 is a flowchart of a decryption method based on bluetooth communication according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a change of the mapping relationship between the device a and the device B according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In one embodiment, as shown in fig. 1, an encryption method based on bluetooth communication includes the following steps:
and step S1, pairing and connecting the Bluetooth device A and the Bluetooth device B, wherein the connection process follows a Bluetooth standard interconnection protocol and is suitable for various protocols such as classic Bluetooth BT, low-power Bluetooth BLE, Bluetooth HID and the like.
In this embodiment, because the bluetooth connection solves the problem of the transmission link layer, the present invention only encrypts and decrypts the transmitted data portion, and uses the bluetooth to transparently transmit the ciphertext data without affecting the communication frame header and the frame tail of the bluetooth protocol, so that the method can be also applied to encryption and decryption of all communication data, including wired communication and wireless communication.
Step S2, when the bluetooth device a needs to send data to the bluetooth device B, the current time is obtained through the device a, and then a random number is generated with the time as a seed.
In this embodiment, a random number is generated based on time, but of course, other methods for generating a random number may be adopted, such as generating an encryption key and a discrete table based on the id number of the device U, a coordinate parameter, or other methods for generating a random number map, so as to realize random variation of the encryption key and the data discrete table.
Step S3, the bluetooth device a performs mapping lookup from the storage area according to the random number to obtain the encryption key and the data discrete table of the current data.
The encryption and decryption key and the data discrete table can be written into the storage space of the equipment in advance when the equipment leaves a factory, and for each group of independent data, the equipment searches the key and the data discrete table through random numbers to symmetrically encrypt or decrypt the data. Optionally, the mapping relationship between the random number and the encryption key and between the random number and the data discrete table is defined by the user, the mapping relationship may be fixed or variable, the specific variation mode of the mapping relationship is configured in a later period or automatically converted according to time, and the user designs and considers the mapping relationship. Preferably, the mapping relationship between the random number and the encryption/decryption key and the data discrete table can be changed at any time by two parties of the communication equipment, for example, once an hour or once a day, so that the deciphering difficulty of the eavesdropping party is further improved.
The specific mapping relation synchronous change method is that as shown in fig. 3, a bluetooth device a initiates a request for changing the encryption mapping relation to a bluetooth device B at every day zero time, and proposes a mapping scheme X, the bluetooth device B temporarily changes its own encryption mapping mode to X after receiving the request, and replies an encryption confirmation message to the bluetooth device a, the bluetooth device a changes its own encryption mapping mode to X after receiving the confirmation reply, and sends a confirmation instruction to the bluetooth device B, and the bluetooth device B changes its own encryption mapping mode to X after receiving the confirmation instruction, so as to realize a three-way handshake interaction process in which the device A, B simultaneously changes the encryption mode.
Step S4, the bluetooth device a symmetrically encrypts the plaintext data by using the secret key, and then performs discrete processing on the encrypted data: and exchanging the data of the sending group pairwise, specifically selecting and exchanging the data according to the obtained discrete table.
Step S5, the bluetooth device a encapsulates the ciphertext data and the random number generated this time into a data packet, and sends the data packet to the bluetooth device B.
In this embodiment, the encapsulation positions of the ciphertext data and the random number in the data packet are not limited, and the length of a single data packet is also variable according to different protocols. Optionally, based on the limitation of BT and BLE communication lengths, the data transmitted by the user may be segmented and fixed in length, so as to simplify the design of the discrete data table, for example: due to protocol limitation, the BLE communication can only transmit 20 bytes of data in a single frame, the data to be transmitted can be pre-grown into a plurality of 18-byte data segments for encryption and discretization transmission, and random numbers encrypted at this time are mounted in 19 and 20 bytes.
The encryption method of this embodiment is data discrete encryption, so as to implement the randomization of the key of symmetric encryption and the data discrete method. In addition, various symmetric encryption modes such as exclusive-or encryption, DES encryption, AES encryption and the like can be adopted in the encryption process.
In another embodiment, as shown in fig. 2, a decryption method based on bluetooth communication is further included, the decryption method including the steps of:
step S6, the Bluetooth device B receives the data packet sent by the device A, extracts the random number, and searches and obtains the decryption key and the data discrete table of the current data from the storage area of the Bluetooth device B, and the decryption key and the discrete data table of the device B are consistent with those of the device A when the device A encrypts due to symmetric encryption and decryption;
and step S7, the Bluetooth device B exchanges and restores the two-two data of the ciphertext data according to the discrete table, and symmetrically decrypts the ciphertext according to the decryption key to obtain the plaintext data.
The encryption and decryption method based on Bluetooth communication does not need to increase hardware design and overhead, only needs the equipment platform to have the function of generating random numbers, and can realize transplantation by the encryption and decryption algorithm; the encryption method has high time discreteness, short time consumption and good confidentiality. And the key and the data discrete table can be changed with the mapping relation between the key and the random number at any time, thereby improving the confidentiality and the safety of the Bluetooth communication equipment and meeting the use requirements of users.
The above-mentioned embodiments only express the specific embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.

Claims (7)

1. An encryption and decryption method based on Bluetooth communication is characterized by comprising the following steps:
step S1, carrying out pairing connection on the device A and the device B through a Bluetooth protocol;
step S2, when data transmission is needed, the device A generates a random number;
step S3, the device A maps and searches from the storage area through the random number, and obtains the encryption key and the data discrete table corresponding to the random number;
step S4, carrying out symmetric encryption on plaintext data through the secret key, and then carrying out discrete processing on the encrypted data to obtain ciphertext data;
step S5, the device A encapsulates the ciphertext data and the generated random number into a data packet and sends the data packet to the device B;
step S6, the device B receives the data packet, extracts the random number from the data packet, and obtains the decryption key and the data discrete table corresponding to the random number from the storage area of the device B;
and S7, the device B restores the data of the ciphertext according to the discrete table, and symmetrically decrypts the ciphertext according to the decryption key to obtain plaintext data.
2. The encryption and decryption method based on bluetooth communication according to claim 1, wherein the method for generating the random number in step S2 is as follows: the device a generates a random number by the current time, device UID number or coordinate parameters.
3. The encryption and decryption method based on bluetooth communication according to claim 1, wherein the encryption and decryption keys and the data discrete table are written in a memory space of the device in advance.
4. The encryption and decryption method based on Bluetooth communication according to claim 3, wherein the mapping relationship between the random number and the encryption and decryption key and the data discrete table is synchronously changed in the device.
5. The encryption and decryption method based on Bluetooth communication according to claim 4, wherein the method for changing the mapping relationship comprises: the device A initiates a request for changing the encryption mapping relation to the device B at regular time, proposes a new mapping relation X, and synchronously changes the mapping relation between the device A and the device B into X in a three-handshake interaction mode.
6. The encryption and decryption method based on bluetooth communication according to claim 1, wherein the step S4 further includes dividing plaintext data into a plurality of data segments with fixed bytes, and then performing symmetric encryption and discretization on the data segments to obtain a plurality of pieces of ciphertext data.
7. The encryption and decryption method based on Bluetooth communication according to claim 1, wherein the symmetric encryption adopts one of XOR encryption, DES encryption, AES encryption or data discrete encryption.
CN202011004619.1A 2020-09-22 2020-09-22 Encryption and decryption method based on Bluetooth communication Pending CN112188485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011004619.1A CN112188485A (en) 2020-09-22 2020-09-22 Encryption and decryption method based on Bluetooth communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011004619.1A CN112188485A (en) 2020-09-22 2020-09-22 Encryption and decryption method based on Bluetooth communication

Publications (1)

Publication Number Publication Date
CN112188485A true CN112188485A (en) 2021-01-05

Family

ID=73955896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011004619.1A Pending CN112188485A (en) 2020-09-22 2020-09-22 Encryption and decryption method based on Bluetooth communication

Country Status (1)

Country Link
CN (1) CN112188485A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953902A (en) * 2021-01-26 2021-06-11 湖南北斗微芯数据科技有限公司 Industrial Internet of things data encryption communication system and method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515769A (en) * 2016-01-12 2016-04-20 汉柏科技有限公司 Dynamic password generation method and dynamic password generation system for network equipment
CN105703902A (en) * 2016-01-12 2016-06-22 汉柏科技有限公司 Random number generating method and device used for network device
CN105760765A (en) * 2016-02-04 2016-07-13 北京致远协创软件有限公司 Data encrypting method and device and data decrypting method and device
CN106254327A (en) * 2016-07-28 2016-12-21 努比亚技术有限公司 Information processor and method
CN106714146A (en) * 2015-11-13 2017-05-24 广西咪付网络技术有限公司 Communication encryption method for Bluetooth BLE devices
CN107592200A (en) * 2016-07-08 2018-01-16 展讯通信(上海)有限公司 Data encryption, the method and device of decryption
CN109241760A (en) * 2018-09-28 2019-01-18 北京北信源信息安全技术有限公司 Data ciphering method, decryption method, encryption device and decryption device
CN109714743A (en) * 2019-02-21 2019-05-03 广州技象科技有限公司 A kind of Bluetooth encryption communication means and Bluetooth encryption communication system
CN110210591A (en) * 2019-06-05 2019-09-06 金邦达有限公司 A kind of wiring method, computer installation and the computer readable storage medium of intellective IC card personal data
CN110620792A (en) * 2019-10-24 2019-12-27 福建星网视易信息系统有限公司 Communication encryption method, communication device, system, and computer-readable storage medium
CN111416702A (en) * 2020-03-09 2020-07-14 上海数据交易中心有限公司 Data transmission method, data transmission system and computer readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106714146A (en) * 2015-11-13 2017-05-24 广西咪付网络技术有限公司 Communication encryption method for Bluetooth BLE devices
CN105515769A (en) * 2016-01-12 2016-04-20 汉柏科技有限公司 Dynamic password generation method and dynamic password generation system for network equipment
CN105703902A (en) * 2016-01-12 2016-06-22 汉柏科技有限公司 Random number generating method and device used for network device
CN105760765A (en) * 2016-02-04 2016-07-13 北京致远协创软件有限公司 Data encrypting method and device and data decrypting method and device
CN107592200A (en) * 2016-07-08 2018-01-16 展讯通信(上海)有限公司 Data encryption, the method and device of decryption
CN106254327A (en) * 2016-07-28 2016-12-21 努比亚技术有限公司 Information processor and method
CN109241760A (en) * 2018-09-28 2019-01-18 北京北信源信息安全技术有限公司 Data ciphering method, decryption method, encryption device and decryption device
CN109714743A (en) * 2019-02-21 2019-05-03 广州技象科技有限公司 A kind of Bluetooth encryption communication means and Bluetooth encryption communication system
CN110210591A (en) * 2019-06-05 2019-09-06 金邦达有限公司 A kind of wiring method, computer installation and the computer readable storage medium of intellective IC card personal data
CN110620792A (en) * 2019-10-24 2019-12-27 福建星网视易信息系统有限公司 Communication encryption method, communication device, system, and computer-readable storage medium
CN111416702A (en) * 2020-03-09 2020-07-14 上海数据交易中心有限公司 Data transmission method, data transmission system and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112953902A (en) * 2021-01-26 2021-06-11 湖南北斗微芯数据科技有限公司 Industrial Internet of things data encryption communication system and method

Similar Documents

Publication Publication Date Title
US9473941B1 (en) Method, apparatus, and computer program product for creating an authenticated relationship between wireless devices
US20140040618A1 (en) Galois/counter mode encryption in a wireless network
CN101980558B (en) Method for encryption authentication on Ad hoc network transmission layer protocol
CN101917711B (en) A kind of method of mobile communication system and voice call encryption thereof
CN106533656B (en) A kind of key multilayer mixing method for encryption/decryption based on WSN
CN104658090B (en) A kind of smart lock of built-in security module and ZigBee wireless communication modules
CN101707767B (en) Data transmission method and devices
CN102420642B (en) Bluetooth device and communication method thereof
CN116321129B (en) Lightweight dynamic key-based power transaction private network communication encryption method
CN104618204A (en) Intelligent home system for guaranteeing safe and remote control based on security modules and realization method thereof
CN105227298A (en) Based on the intelligent substation message safe transmission implementation method of modified model GCM
KR20180096189A (en) LPWA Module performing Encrypted Communication and method thereof
CN104602208B (en) A kind of SMS encryption communication means based on mobile network
CN109194701A (en) A kind of data processing method and device
CN107155184A (en) A kind of WIFI module and its communication means with security encryption chip
CN112188485A (en) Encryption and decryption method based on Bluetooth communication
CN207706196U (en) Power line carrier and wireless double mode secure communication device
Hong et al. Research on fusion encryption algorithm for internet of things monitoring equipment
CN105228096B (en) A kind of communication establishing method and device based on WIFI
CN104901966B (en) A kind of cipher key configuration method and system of network communication
CN109410394A (en) A kind of method for sending information and information transmitting system of intelligent door lock
CN113795023A (en) Bluetooth data transmission encryption method based on chaotic sequence and block encryption
CN104335621A (en) Association identifier communication device and association identifier communication method
CN102355356A (en) Asymmetric encryption method suitable for ZIGBEE wireless meter reading
CN115567195A (en) Secure communication method, client, server, terminal and network side 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210105