CN116074826B - Communication data encryption and decryption method and device applied to electric scooter - Google Patents

Communication data encryption and decryption method and device applied to electric scooter Download PDF

Info

Publication number
CN116074826B
CN116074826B CN202310209761.7A CN202310209761A CN116074826B CN 116074826 B CN116074826 B CN 116074826B CN 202310209761 A CN202310209761 A CN 202310209761A CN 116074826 B CN116074826 B CN 116074826B
Authority
CN
China
Prior art keywords
data
electric scooter
decryption
target
target electric
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
CN202310209761.7A
Other languages
Chinese (zh)
Other versions
CN116074826A (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 Hobbywing Technology Co Ltd
Original Assignee
Shenzhen Hobbywing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Hobbywing Technology Co Ltd filed Critical Shenzhen Hobbywing Technology Co Ltd
Priority to CN202310209761.7A priority Critical patent/CN116074826B/en
Publication of CN116074826A publication Critical patent/CN116074826A/en
Application granted granted Critical
Publication of CN116074826B publication Critical patent/CN116074826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

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

Abstract

The embodiment of the application discloses a communication data encryption and decryption method and device applied to an electric scooter, wherein the method comprises the following steps: responding to the connected state between the target electric scooter and the target mobile terminal equipment, and acquiring a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment; in response to the condition that the target electric scooter and the target mobile terminal equipment are in a data communication interaction possible state, carrying out data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data; and performing data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by a processing model corresponding to the second preset mode are both optimization algorithms of which the calculation amount of the related micro control unit is smaller than a preset value.

Description

Communication data encryption and decryption method and device applied to electric scooter
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a communication data encryption and decryption method, a device, a storage medium, electronic equipment and a computer program product applied to an electric scooter.
Background
In the electric scooter field, because the data volume of transmission is not big, at present, often through low-power consumption BLE (Blue Tooth) equipment with realize the data interaction between electric scooter and the smart machine. Bluetooth devices are classified into peripheral devices (e.g., electric scooter) and center devices (e.g., cellular phones), however, there is a risk of interception and MITM (man-in-the-middle attack) when communication is performed between the electric scooter and the cellular phone, thereby causing communication data and instructions for controlling the peripheral devices to be intercepted, and thus, how to secure encryption of the communication data during communication between the electric scooter and the cellular phone becomes particularly important.
At present, although there are many common algorithms for encrypting data, considering the application scenario specificity of the electric scooter, for example, the MCU (Microcontroller Unit, micro control unit) has limited computing capability, limited memory resources of the MCU, high real-time communication requirement of the mobile phone, or no limitation factor such as internet connection, so a data encryption and decryption method with fast execution speed and less occupied resources needs to be adopted.
Disclosure of Invention
Based on the above, it is necessary to provide a method, a device, a storage medium, an electronic device and a computer program product for encrypting and decrypting communication data applied to an electric scooter, aiming at the problems that the existing method for encrypting and decrypting communication data applied to the electric scooter cannot meet the requirements of the application scene of the electric scooter, and the execution speed is high and the occupied resources are small.
In a first aspect, an embodiment of the present application provides a method for encrypting and decrypting communication data applied to an electric scooter, where the method includes:
responding to the connected state between a target electric scooter and target mobile terminal equipment, and acquiring a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment;
responding to the state that the target electric scooter and the target mobile terminal equipment can perform data communication interaction, and performing data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data;
and carrying out data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by the processing model corresponding to the second preset mode are optimization algorithms of which the operand of the related micro control unit is smaller than a preset value.
In one possible implementation manner, the obtaining the first key corresponding to the target electric scooter includes:
acquiring a Bluetooth address of the target electric scooter;
and reading ASCII codes in the Bluetooth addresses, and carrying out operation and table lookup processing based on the ASCII codes to obtain a first secret key corresponding to the target electric scooter.
In one possible implementation manner, the acquiring the bluetooth address of the target electric scooter includes:
and responding to the operating system adopted by the target mobile terminal equipment in the Bluetooth connection state with the target electric scooter as an android system, and acquiring the Bluetooth address of the target electric scooter.
In one possible implementation manner, the acquiring the bluetooth address of the target electric scooter includes:
and responding to the fact that an operating system adopted by the target mobile terminal equipment in a Bluetooth connection state with the target electric scooter is an android system which is an ISO system, and acquiring a Bluetooth address of the target electric scooter by subscribing the Bluetooth service through Bluetooth service added on the target electric scooter.
In one possible implementation manner, the performing data encryption processing on the corresponding communication data by using a first preset manner to obtain corresponding encrypted data includes:
and selecting a specific value in the first secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the first preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a first plaintext and a first ciphertext.
In one possible implementation manner, the performing data decryption processing on the encrypted data by using a second preset manner to obtain corresponding decrypted data includes:
and selecting a specific value in the second secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the second preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a second ciphertext and a second plaintext.
In one possible implementation, the method further includes:
reading the encryption source code corresponding to the encryption data;
the encryption source code corresponding to the encryption data comprises at least one parameter as follows;
the first address of the data to be encrypted, the first address of the data after being stored with the secret, the data length of the data to be encrypted and the key selection type; and/or the number of the groups of groups,
reading a decryption source code corresponding to the decryption data;
wherein, the decryption source code corresponding to the decryption data comprises at least one parameter as follows;
the first address of the data to be decrypted, the first address of the data after being decrypted, the data length of the data to be decrypted and the key selection type are stored.
In one possible implementation, the method further includes: reading the first plaintext and the first ciphertext; and reading the second ciphertext and the second plaintext;
and under the condition that the first plaintext is consistent with the second plaintext, and the first ciphertext is consistent with the second ciphertext, determining that the target electric scooter and the target mobile terminal equipment have the authority of data communication.
In a second aspect, an embodiment of the present application provides a communication data encryption and decryption device applied to an electric scooter, including:
the acquisition module is used for responding to the connected state between the target electric scooter and the target mobile terminal equipment to acquire a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment;
the encryption module is used for carrying out data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data in response to the condition that the target electric scooter and the target mobile terminal equipment are in a data communication interaction state;
the decryption module is used for carrying out data decryption processing on the encrypted data by adopting a second preset mode, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by a processing model corresponding to the second preset mode are optimization algorithms of which the calculation amount of the related micro control unit is smaller than a preset value.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program for performing the above-described method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method steps described above.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the above-described method steps.
In the embodiment of the application, a first key corresponding to a target electric scooter and a second key corresponding to target mobile terminal equipment are acquired in response to the fact that the target electric scooter and the target mobile terminal equipment are in a connected state; in response to the condition that the target electric scooter and the target mobile terminal equipment are in a data communication interaction possible state, carrying out data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data; and performing data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by a processing model corresponding to the second preset mode are both optimization algorithms of which the calculation amount of the related micro control unit is smaller than a preset value. According to the communication data encryption and decryption method applied to the electric scooter, as the first algorithm adopted by the processing model corresponding to the first preset mode and the second algorithm adopted by the processing model corresponding to the second preset mode are both optimization algorithms with the related calculation amounts of the micro control units smaller than the preset value, the requirements of high execution speed and less occupied resources required by the application scene of the electric scooter can be effectively met.
Drawings
Exemplary embodiments of the present invention may be more fully understood by reference to the following drawings. The accompanying drawings are included to provide a further understanding of embodiments of the application and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the application, and not constitute a limitation of the invention. In the drawings, like reference numerals generally refer to like parts or steps.
Fig. 1 is a flowchart of a communication data encryption and decryption method applied to an electric scooter according to an exemplary embodiment of the present application;
fig. 2 is a schematic diagram of a set of 16 group keys adopted by the acquired keys in a specific application scenario of the present application;
fig. 3 is a schematic structural diagram of a communication data encryption and decryption device 500 applied to an electric scooter according to an exemplary embodiment of the present application;
FIG. 4 illustrates a schematic diagram of an electronic device provided in an exemplary embodiment of the present application;
fig. 5 shows a schematic diagram of a computer-readable medium according to an exemplary embodiment of the present application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
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.
In addition, the terms "first" and "second" etc. are used to distinguish different objects and are not used to describe a particular order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides a communication data encryption and decryption method and device applied to an electric scooter, electronic equipment and a computer readable medium, and the method and the device are described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a communication data encryption and decryption method applied to an electric scooter according to some embodiments of the present application is shown, and as shown in fig. 1, the communication data encryption and decryption method applied to an electric scooter may include the following steps:
step S101: and responding to the connected state between the target electric scooter and the target mobile terminal equipment, and acquiring a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment.
In an actual application scenario, the first key corresponding to the obtained target electric scooter and the second key corresponding to the target mobile terminal device may specifically be: random permutation of 16 values (0 x00-0x 0F).
The key set is the set of all keys.
A random permutation of 16 values totals 20922789888000 combinations:
16!= 20922789888000;
therefore, the maximum value of the key set can be 20922789888000, and the communication data encryption and decryption method applied to the electric scooter provided by the embodiment of the application adopts 16 groups of keys (according to the application scene, different key groups are adopted, the larger the key group is, the higher the security is), as shown in fig. 2, which is a schematic diagram of the set of 16 groups of keys adopted by the acquired keys in the specific application scene of the application.
In one possible implementation manner, the method for obtaining the first key corresponding to the target electric scooter includes the following steps:
acquiring a Bluetooth address of a target electric scooter;
and reading ASCII codes in the Bluetooth addresses, and carrying out operation and table lookup processing based on the ASCII codes to obtain a first secret key corresponding to the target electric scooter.
In a practical application scenario, the Bluetooth address of the electric scooter is FB: F5: FF:00 (Bluetooth address is 6 bytes separated by a colon). In the communication data encryption and decryption method applied to the electric scooter provided by the embodiment of the application, ASCII codes corresponding to Bluetooth addresses are adopted for operation, and then a table is searched to obtain a key (Key type). The ASCII code corresponding to the Bluetooth address is as follows:
0x46 0x42 0x46 0x35 0x46 0x46 0x30 0x30 0x46 0x46 0x30 0x30。
since only 16 sets of keys are employed, the ASCII codes corresponding to bluetooth addresses are accumulated (sum=0x2db) and then the lower four bits are taken.
Keytype = Sum & 0xF
= 0x2DB & 0xF
= 0xB
0xB is decimal 12, so the key is:
Key[12][16]={0x0F,0x03,0x0E,0x0B,0x06,0x08,0x04,0x01,0x02,0x0C,0x0D,0x0A,0x05,0x00,0x09,0x07}。
in one possible implementation manner, the method for acquiring the bluetooth address of the target electric scooter includes the following steps:
and responding to the android system adopted by the target mobile terminal equipment in the Bluetooth connection state with the target electric scooter, and acquiring the Bluetooth address of the target electric scooter.
In one possible implementation manner, the method for acquiring the bluetooth address of the target electric scooter includes the following steps:
and responding to the fact that an operating system adopted by target mobile terminal equipment in a Bluetooth connection state with the target electric scooter is an android system which is an ISO system, and acquiring a Bluetooth address of the target electric scooter by subscribing the Bluetooth service through Bluetooth service added on the target electric scooter.
By means of the mode, the communication data encryption and decryption method provided by the embodiment of the application can adapt to different operating systems.
Step S102: and in response to the condition that the target electric scooter and the target mobile terminal equipment are in a data communication interaction possible state, carrying out data encryption processing on corresponding communication data by adopting a first preset mode to obtain corresponding encrypted data, wherein a first algorithm adopted by a processing model corresponding to the first preset mode is an optimization algorithm with the operand of a related micro control unit being smaller than a preset value.
In an actual application scenario, the preset value may be set and adjusted, where the preset value is not specifically limited.
The method comprises the following steps of:
and selecting a specific value in the first key by adopting a mode of character sequence replacement, and replacing the character corresponding to the first preset position to obtain a corresponding key, wherein the corresponding key comprises a first plaintext and a first ciphertext.
In a possible implementation manner, the method for encrypting and decrypting communication data applied to an electric scooter provided by the embodiment of the application further includes the following steps:
reading an encryption source code corresponding to the encryption data;
the encryption source code corresponding to the encryption data comprises at least one parameter as follows;
the first address of the data to be encrypted, the first address of the data after being stored with the secret, the data length of the data to be encrypted and the key selection type.
It should be noted that, the first algorithm adopted by the processing model corresponding to the first preset manner is an optimization algorithm that the operand of the related micro control unit is smaller than the preset value, and just because the optimization algorithm is adopted, the requirements of high execution speed and less occupied resources required by the application scene of the electric scooter can be effectively met. It can be clearly known that: each key parameter included in the encrypted source code corresponding to the encrypted data. It is also known that: the micro control unit related to the processing model corresponding to the communication data encryption method applied to the electric scooter is extremely small in operation amount, and the communication data encryption method is an optimization algorithm applicable to application scenes of the electric scooter.
In the practical application scenario, the key calculated in the step S102 is:
Key[16]={0x0F,0x03,0x0E,0x0B,0x06,0x08,0x04,0x01,0x02,0x0C,0x0D,0x0A,0x05,0x00,0x09,0x07}
0->F 1->3 2->E 3->B 4->6 5->8 6->4 7->1 8->2 9->C A->D B->A C->5 D->0 E->9 F->7
first plain text: tab [3] = {0x0f,0x12,0xe3}
First ciphertext: tab [3] = {0xf7,0x3e,0x9b }.
Step S103: and carrying out data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein a second algorithm adopted by a processing model corresponding to the second preset mode is an optimization algorithm with the operand of the related micro control unit being smaller than a preset value.
In an actual application scenario, the preset value may be set and adjusted, where the preset value is not specifically limited.
In one possible implementation manner, the data decryption processing is performed on the encrypted data by adopting a second preset manner to obtain corresponding decrypted data, and the method includes the following steps:
and selecting a specific value in the second secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the second preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a second ciphertext and a second plaintext.
In a possible implementation manner, the method for encrypting and decrypting communication data applied to an electric scooter provided by the embodiment of the application further includes the following steps:
reading a decryption source code corresponding to the decryption data;
the decryption source code corresponding to the decryption data comprises at least one parameter as follows;
the first address of the data to be decrypted, the first address of the data after being decrypted, the data length of the data to be decrypted and the key selection type are stored.
It should be noted that, the second algorithm adopted by the processing model corresponding to the second preset mode is an optimization algorithm that the operand of the related micro control unit is smaller than the preset value, and just because the optimization algorithm is adopted, the requirements of high execution speed and less occupied resources required by the application scene of the electric scooter can be effectively met. It can be clearly known that: each key parameter included in the decryption source code corresponding to the decryption data. It is also known that: the micro control unit related to the processing model corresponding to the communication data decryption method applied to the electric scooter is extremely small in operation amount, and the communication data decryption method is an optimization algorithm applicable to application scenes of the electric scooter.
In the practical application scenario, the key calculated in the step S103 is:
Key[16]={0x0F,0x03,0x0E,0x0B,0x06,0x08,0x04,0x01,0x02,0x0C,0x0D,0x0A,0x05,0x00,0x09,0x07}
F->0 3->1 E->2 B->3 6->4 8->5 4->6 1->7 2->8 C->9 D->A A->B 5->C 0->D 9->E 7->F
second ciphertext: tab [3] = {0xF7,0x3E,0x9B }
The second plaintext: tab [3] = {0x0f,0x12,0xe3}.
In a possible implementation manner, the method for encrypting and decrypting communication data applied to an electric scooter provided by the embodiment of the application further includes the following steps:
reading a first plaintext and a first ciphertext; reading a second ciphertext and a second plaintext;
and under the condition that the first plaintext is consistent with the second plaintext and the first ciphertext is consistent with the second ciphertext, determining that the target electric scooter and the target mobile terminal equipment have the authority of data communication.
In the practical application scenario, the key calculated in the step S102 is:
Key[16]={0x0F,0x03,0x0E,0x0B,0x06,0x08,0x04,0x01,0x02,0x0C,0x0D,0x0A,0x05,0x00,0x09,0x07}
0->F 1->3 2->E 3->B 4->6 5->8 6->4 7->1 8->2 9->C A->D B->A C->5 D->0 E->9 F->7
first plain text: tab [3] = {0x0f,0x12,0xe3}
First ciphertext: tab [3] = {0xf7,0x3e,0x9b }.
The key calculated by the above step S103 is:
Key[16]={0x0F,0x03,0x0E,0x0B,0x06,0x08,0x04,0x01,0x02,0x0C,0x0D,0x0A,0x05,0x00,0x09,0x07}
F->0 3->1 E->2 B->3 6->4 8->5 4->6 1->7 2->8 C->9 D->A A->B 5->C 0->D 9->E 7->F
second ciphertext: tab [3] = {0xF7,0x3E,0x9B }
The second plaintext: tab [3] = {0x0f,0x12,0xe3}.
The comparison shows that: the first plaintext is consistent with the second plaintext, and the first ciphertext is consistent with the second ciphertext, so that the permission of data communication between the target electric scooter and the target mobile terminal equipment can be determined.
Through the steps, the safety of data communication between the target electric scooter and the target mobile terminal equipment can be effectively ensured, and the data communication between the target electric scooter and the target mobile terminal equipment is allowed only under the condition that the permission of the data communication between the target electric scooter and the target mobile terminal equipment is determined.
According to the communication data encryption and decryption method applied to the electric scooter, as the first algorithm adopted by the processing model corresponding to the first preset mode and the second algorithm adopted by the processing model corresponding to the second preset mode are both optimization algorithms with the related calculation amounts of the micro control units smaller than the preset value, the requirements of high execution speed and less occupied resources required by the application scene of the electric scooter can be effectively met.
In the above embodiment, a method for encrypting and decrypting communication data applied to an electric scooter is provided, and the application further provides a device for encrypting and decrypting communication data applied to an electric scooter. The communication data encryption and decryption device applied to the electric scooter provided by the embodiment of the application can implement the communication data encryption and decryption method applied to the electric scooter, and the communication data encryption and decryption device applied to the electric scooter can be realized in a mode of combining software, hardware or software and hardware. For example, the communication data encryption and decryption device applied to the electric scooter may include integrated or separated functional modules or units to execute corresponding steps in the above methods.
Referring to fig. 3, a schematic diagram of a communication data encryption and decryption device applied to an electric scooter according to some embodiments of the present application is shown. Since the apparatus embodiments are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
As shown in fig. 3, the communication data encryption and decryption device 500 applied to the electric scooter may include:
an obtaining module 501, configured to obtain a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal device in response to a connected state between the target electric scooter and the target mobile terminal device;
the encryption module 502 is configured to perform data encryption processing on corresponding communication data by using a first preset manner in response to a state that the target electric scooter and the target mobile terminal device are in a state that data communication interaction can be performed, so as to obtain corresponding encrypted data;
the decryption module 503 is configured to perform data decryption processing on the encrypted data by using a second preset manner, where a first algorithm used by a processing model corresponding to the first preset manner and a second algorithm used by a processing model corresponding to the second preset manner are both optimization algorithms that involve the micro control unit and have calculation amounts smaller than preset values.
In some implementations of the embodiments of the present application, the obtaining module 501 is configured to:
and reading ASCII codes in the Bluetooth addresses, and carrying out operation and table lookup processing based on the ASCII codes to obtain a first secret key corresponding to the target electric scooter.
In some implementations of the embodiments of the present application, the obtaining module 501 is specifically configured to:
and responding to the android system adopted by the target mobile terminal equipment in the Bluetooth connection state with the target electric scooter, and acquiring the Bluetooth address of the target electric scooter.
In some implementations of the embodiments of the present application, the obtaining module 501 is specifically configured to:
responding to the fact that an operating system adopted by target mobile terminal equipment in a Bluetooth connection state with a target electric scooter is an android system as an IOS system, and acquiring a Bluetooth address of the target electric scooter by subscribing Bluetooth service through Bluetooth service added on the target electric scooter.
In some implementations of the embodiments of the present application, encryption module 502 is to:
and selecting a specific value in the first key by adopting a mode of character sequence replacement, and replacing the character corresponding to the first preset position to obtain a corresponding key, wherein the corresponding key comprises a first plaintext and a first ciphertext.
In some implementations of the embodiments of the present application, the decryption module 503 is configured to:
and selecting a specific value in the second secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the second preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a second ciphertext and a second plaintext.
In some implementations of the embodiments of the present application, the apparatus 500 may further include:
a reading module (not shown in fig. 3) for:
reading an encryption source code corresponding to the encryption data;
the encryption source code corresponding to the encryption data comprises at least one parameter as follows;
the first address of the data to be encrypted, the first address of the data after being stored with the secret, the data length of the data to be encrypted and the key selection type; and/or the number of the groups of groups,
reading a decryption source code corresponding to the decryption data;
the decryption source code corresponding to the decryption data comprises at least one parameter as follows;
the first address of the data to be decrypted, the first address of the data after being decrypted, the data length of the data to be decrypted and the key selection type are stored.
In some implementations of the embodiments of the present application, the reading module is further to:
reading a first plaintext and a first ciphertext; reading a second ciphertext and a second plaintext;
in some implementations of the embodiments of the present application, the apparatus 500 may further include:
a rights determination module (not shown in fig. 3) for:
and under the condition that the first plaintext is consistent with the second plaintext and the first ciphertext is consistent with the second ciphertext, determining that the target electric scooter and the target mobile terminal equipment have the authority of data communication.
In some implementations of the embodiments of the present application, the communication data encryption and decryption device 500 applied to an electric scooter provided in the embodiments of the present application has the same beneficial effects as the communication data encryption and decryption method applied to an electric scooter provided in the foregoing embodiments of the present application because of the same inventive concept.
The embodiment of the application also provides an electronic device corresponding to the communication data encryption and decryption method applied to the electric scooter provided by the foregoing embodiment, where the electronic device may be an electronic device for a server, for example, a server, including an independent server, a distributed server cluster, and the like, so as to execute the communication data encryption and decryption method applied to the electric scooter; the electronic device may also be an electronic device for a client, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, etc., so as to execute the above communication data encryption and decryption method applied to the electric scooter.
Referring to fig. 4, a schematic diagram of an electronic device according to some embodiments of the present application is shown. As shown in fig. 4, the electronic device 40 includes: processor 400, memory 401, bus 402 and communication interface 403, processor 400, communication interface 403 and memory 401 being connected by bus 402; the memory 401 stores a computer program that can be run on the processor 400, and when the processor 400 runs the computer program, the communication data encryption and decryption method applied to the electric scooter described in the application is executed.
The memory 401 may include a high-speed random access memory (RAM: random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is implemented via at least one communication interface 403 (which may be wired or wireless), the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
Bus 402 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be divided into address buses, data buses, control buses, etc. The memory 401 is configured to store a program, and the processor 400 executes the program after receiving an execution instruction, and the communication data encryption and decryption method applied to the electric scooter disclosed in any embodiment of the present application may be applied to the processor 400 or implemented by the processor 400.
The processor 400 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 400 or by instructions in the form of software. The processor 400 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 401, and the processor 400 reads the information in the memory 401, and in combination with its hardware, performs the steps of the above method.
The electronic equipment provided by the embodiment of the application and the communication data encryption and decryption method applied to the electric scooter provided by the embodiment of the application have the same beneficial effects as the method adopted, operated or realized by the electronic equipment and the method provided by the embodiment of the application because of the same inventive concept.
The embodiment of the present application further provides a computer readable medium corresponding to the communication data encryption and decryption method applied to the electric scooter provided in the foregoing embodiment, referring to fig. 5, the computer readable storage medium is shown as an optical disc 50, on which a computer program (i.e. a program product) is stored, where the computer program when executed by a processor performs the foregoing communication data encryption and decryption method applied to the electric scooter.
It should be noted that examples of the computer readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical or magnetic storage medium, which will not be described in detail herein.
The computer readable storage medium provided by the above embodiment of the present application and the communication data encryption and decryption method applied to the electric scooter provided by the embodiment of the present application are the same inventive concept, and have the same beneficial effects as the method adopted, operated or implemented by the application program stored therein.
It is noted that the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, 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 systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units 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 may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
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 present application has been described in detail with reference to the foregoing embodiments, it should 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 embodiments, and are intended to be included within the scope of the claims and description.

Claims (8)

1. A communication data encryption and decryption method applied to an electric scooter comprises the following steps:
responding to the connected state between a target electric scooter and target mobile terminal equipment, and acquiring a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment;
responding to the state that the target electric scooter and the target mobile terminal equipment can perform data communication interaction, and performing data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data;
the data encryption processing is performed on the corresponding communication data by adopting a first preset mode to obtain corresponding encrypted data, and the method comprises the following steps:
selecting a specific value in the first secret key by adopting a mode of character sequence replacement, and replacing a character corresponding to a first preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a first plaintext and a first ciphertext;
performing data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by a processing model corresponding to the second preset mode are optimization algorithms of which the calculation amount of a related micro control unit is smaller than a preset value;
and performing data decryption processing on the encrypted data by adopting a second preset mode to obtain corresponding decrypted data, wherein the method comprises the following steps:
and selecting a specific value in the second secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the second preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a second ciphertext and a second plaintext.
2. The method of claim 1, wherein the obtaining the first key corresponding to the target electric scooter comprises:
acquiring a Bluetooth address of the target electric scooter;
and reading ASCII codes in the Bluetooth addresses, and carrying out operation and table lookup processing based on the ASCII codes to obtain a first secret key corresponding to the target electric scooter.
3. The method of claim 2, wherein the obtaining the bluetooth address of the target electric scooter comprises:
and responding to the operating system adopted by the target mobile terminal equipment in the Bluetooth connection state with the target electric scooter as an android system, and acquiring the Bluetooth address of the target electric scooter.
4. The method of claim 2, wherein the obtaining the bluetooth address of the target electric scooter comprises:
and responding to the fact that an operating system adopted by the target mobile terminal equipment in a Bluetooth connection state with the target electric scooter is an android system which is an ISO system, and acquiring a Bluetooth address of the target electric scooter by subscribing the Bluetooth service through Bluetooth service added on the target electric scooter.
5. The method of claim 1, further comprising:
reading the encryption source code corresponding to the encryption data;
the encryption source code corresponding to the encryption data comprises at least one parameter as follows;
the first address of the data to be encrypted, the first address of the data after being stored with the secret, the data length of the data to be encrypted and the key selection type; and/or the number of the groups of groups,
reading a decryption source code corresponding to the decryption data;
wherein, the decryption source code corresponding to the decryption data comprises at least one parameter as follows;
the first address of the data to be decrypted, the first address of the data after being decrypted, the data length of the data to be decrypted and the key selection type are stored.
6. The method of claim 5, further comprising: reading the first plaintext and the first ciphertext; and reading the second ciphertext and the second plaintext;
and under the condition that the first plaintext is consistent with the second plaintext, and the first ciphertext is consistent with the second ciphertext, determining that the target electric scooter and the target mobile terminal equipment have the authority of data communication.
7. A communication data encryption and decryption device applied to an electric scooter comprises:
the acquisition module is used for responding to the connected state between the target electric scooter and the target mobile terminal equipment to acquire a first key corresponding to the target electric scooter and a second key corresponding to the target mobile terminal equipment;
the encryption module is used for carrying out data encryption processing on corresponding communication data in a first preset mode to obtain corresponding encrypted data in response to the condition that the target electric scooter and the target mobile terminal equipment are in a data communication interaction state;
the encryption module is specifically used for:
selecting a specific value in the first secret key by adopting a mode of character sequence replacement, and replacing a character corresponding to a first preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a first plaintext and a first ciphertext;
the decryption module is used for carrying out data decryption processing on the encrypted data by adopting a second preset mode, wherein a first algorithm adopted by a processing model corresponding to the first preset mode and a second algorithm adopted by a processing model corresponding to the second preset mode are optimization algorithms of which the calculation amount of the related micro control unit is smaller than a preset value;
the decryption module is specifically configured to:
and selecting a specific value in the second secret key by adopting a mode of character sequence replacement, and replacing the character corresponding to the second preset position to obtain a corresponding secret key, wherein the corresponding secret key comprises a second ciphertext and a second plaintext.
8. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method of any one of the preceding claims 1 to 6.
CN202310209761.7A 2023-03-07 2023-03-07 Communication data encryption and decryption method and device applied to electric scooter Active CN116074826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310209761.7A CN116074826B (en) 2023-03-07 2023-03-07 Communication data encryption and decryption method and device applied to electric scooter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310209761.7A CN116074826B (en) 2023-03-07 2023-03-07 Communication data encryption and decryption method and device applied to electric scooter

Publications (2)

Publication Number Publication Date
CN116074826A CN116074826A (en) 2023-05-05
CN116074826B true CN116074826B (en) 2023-06-23

Family

ID=86182084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310209761.7A Active CN116074826B (en) 2023-03-07 2023-03-07 Communication data encryption and decryption method and device applied to electric scooter

Country Status (1)

Country Link
CN (1) CN116074826B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113079002A (en) * 2021-03-26 2021-07-06 北京深思数盾科技股份有限公司 Data encryption method, data decryption method, key management method, medium, and device
CN114218592A (en) * 2021-12-20 2022-03-22 平安壹钱包电子商务有限公司 Sensitive data encryption and decryption method and device, computer equipment and storage medium

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9756024B2 (en) * 2015-09-18 2017-09-05 Trillium Incorporated Computer-implemented cryptographic method for improving a computer network, and terminal, system and computer-readable medium for the same
CN106184072A (en) * 2016-07-19 2016-12-07 成都安程通科技有限公司 automobile ECU information monitoring system based on mobile terminal
CN107094036A (en) * 2017-04-24 2017-08-25 深圳市科漫达智能管理科技有限公司 A kind of cipher key processing method and Bluetooth terminal based on bluetooth communication
JP2019033450A (en) * 2017-08-09 2019-02-28 オムロンヘルスケア株式会社 Information processing system, data transmitting apparatus, data receiving apparatus, information processing method, and program
EP3594838A1 (en) * 2018-07-09 2020-01-15 Skeyecode Method for recovering a secret key securely stored in a secure element
CN110489989A (en) * 2019-08-27 2019-11-22 深圳市道通智能航空技术有限公司 Data encrypting/de-encrypling method, its encryption/deciphering chip and its unmanned plane
KR20210031168A (en) * 2019-09-11 2021-03-19 삼성전자주식회사 Electronic device for receiving data packet in bluetooth network environment and method thereof
CN110933063B (en) * 2019-11-25 2022-02-18 中国联合网络通信集团有限公司 Data encryption method, data decryption method and equipment
CN112950813A (en) * 2019-11-26 2021-06-11 纳恩博(常州)科技有限公司 Intelligent lock device, scooter, intelligent lock body control method thereof and storage medium
CN114802550B (en) * 2021-01-27 2023-10-20 纳恩博(常州)科技有限公司 Unlocking method and device for electric scooter, electric scooter and storage medium
CN113613227B (en) * 2021-08-09 2023-10-24 青岛海尔科技有限公司 Data transmission method and device of Bluetooth equipment, storage medium and electronic device
CN113792305B (en) * 2021-08-18 2023-11-14 广州城建职业学院 Encryption and decryption method, system, equipment and computer readable storage medium
CN114386104A (en) * 2022-01-17 2022-04-22 零氪科技(北京)有限公司 Method for storing sensitive data, data reading method and device
CN114726833A (en) * 2022-05-06 2022-07-08 深圳市乐骑智能科技有限公司 Intelligent electric scooter registration binding system and method based on Internet of things

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113079002A (en) * 2021-03-26 2021-07-06 北京深思数盾科技股份有限公司 Data encryption method, data decryption method, key management method, medium, and device
CN114218592A (en) * 2021-12-20 2022-03-22 平安壹钱包电子商务有限公司 Sensitive data encryption and decryption method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN116074826A (en) 2023-05-05

Similar Documents

Publication Publication Date Title
EP2803009B1 (en) Virtual machine device having key driven obfuscation and method
CN105490711B (en) Bluetooth automatic connection method and main equipment, from equipment and system
US10986095B2 (en) Systems and methods for controlling network access
US10999260B1 (en) Secure messaging between cryptographic hardware modules
US8036379B2 (en) Cryptographic processing
US20200104528A1 (en) Data processing method, device and system
CN104331644A (en) Transparent encryption and decryption method for intelligent terminal file
US8667305B2 (en) Securing a password database
CN111262910B (en) Wireless equipment firmware protection method and system
US10075301B2 (en) Relational encryption for password verification
US11228422B2 (en) Configuring a device based on a DPA countermeasure
CN107786331A (en) Data processing method, device, system and computer-readable recording medium
CN105207772A (en) Cryptographic method for securely exchanging messages and device and system for implementing this method
CN103701829A (en) Method of off-line analyzing DPAPI (Data Protection Application Programming Interface) enciphered data
KR102000244B1 (en) Blockchain system based on Zero Knowledge Proofs with Format-Preserving Encryption and control method thereof
CN105069365A (en) Data processing method and mobile terminal
US20170244677A1 (en) Operation method based on white-box cryptography and secure terminal for performing the method
CN112636903A (en) Construction method, encryption method, decryption method, device, equipment and storage medium
CN116074826B (en) Communication data encryption and decryption method and device applied to electric scooter
CN116070293A (en) Processing method and device for firmware protection through chip encryption
CN109995527B (en) Key interaction method and device, upper computer, lower computer and storage medium
CN111104693A (en) Android platform software data cracking method, terminal device and storage medium
US20210344483A1 (en) Methods, apparatus, and articles of manufacture to securely audit communications
US9838199B2 (en) Initialization vectors generation from encryption/decryption
US8862868B2 (en) Systems and methods for controlling email access

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