ADB data transmission encryption and decryption system and method
By generating and decrypting encryption keys in ADB tools, the security issues caused by the lack of encryption on Android devices are resolved, thus achieving security for ADB data transmission and protection for the device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 武汉凡鱼科技有限公司
- Filing Date
- 2023-04-26
- Publication Date
- 2026-07-07
AI Technical Summary
Existing Android devices do not encrypt ADB tools, so their security cannot be guaranteed.
An encryption key is generated on the key generation device, transmitted to the ADB client, and then decrypted on the ADB device via the ADB server. Data transmission can only proceed if decryption is successful. The encryption key is generated using the MD5 encryption algorithm and logical operations, and is split and logically operated on the device to improve security.
It ensures the security of ADB data transmission, prevents unauthorized access and malicious damage, and improves device security.
Smart Images

Figure CN116723001B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data encryption technology, and in particular to an ADB data transmission encryption and decryption system and method. Background Technology
[0002] Android Debug Bridge (ADB) is a tool in the Android SDK, designed to facilitate debugging of devices or developed Android apps. ADB acts as a bridge between Android phones and PCs, enabling users to perform comprehensive operations on their phones from their computers. However, currently, Android devices do not encrypt ADB, making its security uncertain.
[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide an ADB data transmission encryption and decryption system and method, aiming to solve the technical problem of how to ensure the security of using ADB tools.
[0005] To achieve the above objectives, the present invention provides an ADB data transmission encryption and decryption system, which includes the following steps:
[0006] The key generation device is used to generate an encryption key based on the collected device information and transmit the encryption key to the ADB client;
[0007] The ADB client is used to receive the encryption key and transmit the encryption key and operation instructions to the ADB server;
[0008] The ADB server is used to receive the encryption key and the operation instruction, and to transmit the encryption key and the operation instruction to the adbd device.
[0009] The adbd device is used to receive the encryption key and the operation command, and to decrypt the encryption key;
[0010] The adbd device is also used to transmit data according to the operation instructions when decryption is successful.
[0011] Optionally, the key generation device is further configured to encrypt the collected device information and a preset encryption algorithm to obtain encrypted ciphertext;
[0012] The key generation device is also used to split the encrypted ciphertext and select a portion of the split ciphertext for encryption.
[0013] The key generation device is further configured to generate an encryption key based on the partially split encrypted ciphertext and logical operations, and transmit the encryption key to the ADB client.
[0014] Optionally, the preset encryption algorithm is specifically:
[0015] MD5 = GetMD5(data);
[0016] In the formula, data represents the device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext;
[0017] Furthermore, the encryption key is specifically:
[0018] lock_passwd_data = key + logical operation;
[0019] In the formula, key represents the encrypted ciphertext after the part is split.
[0020] Optionally, the ADB data transmission encryption / decryption system further includes: a detection device.
[0021] The detection device is used to send a re-encryption request to the ADB client when it detects that the adbd device has lost connection with the ADB server.
[0022] Optionally, the adbd device is also configured to transmit a command to close the ADB client to the ADB server when decryption fails;
[0023] The ADB server is also configured to receive the command to shut down the ADB client and transmit the command to the ADB client.
[0024] The ADB client is also used to receive the command to close the ADB client and to display a pop-up window indicating a password error.
[0025] Furthermore, to achieve the above objectives, the present invention also proposes an ADB data transmission encryption and decryption method, which is applied to the ADB data transmission encryption and decryption system, the system comprising: a key generation device, an ADB client, an ADB server, and an adbd device.
[0026] The key generation device generates an encryption key based on the collected device information and transmits the encryption key to the ADB client;
[0027] The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server;
[0028] The ADB server receives the encryption key and the operation instruction, and transmits the encryption key and the operation instruction to the adbd device.
[0029] The adbd device receives the encryption key and the operation command, and decrypts the encryption key;
[0030] When the adbd device successfully decrypts, it transmits data according to the operation instructions.
[0031] Optionally, the step of the key generation device generating an encryption key based on the collected device information and transmitting the encryption key to the ADB client includes:
[0032] The key generation device encrypts the collected device information and a preset encryption algorithm to obtain encrypted ciphertext.
[0033] The key generation device splits the encrypted ciphertext and selects a portion of the split ciphertext for encryption.
[0034] The key generation device generates an encryption key based on the partially split encrypted ciphertext and logical operations, and transmits the encryption key to the ADB client.
[0035] Optionally, the preset encryption algorithm is specifically:
[0036] MD5 = GetMD5(data);
[0037] In the formula, data represents the device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext;
[0038] Furthermore, the encryption key is specifically:
[0039] lock_passwd_data = key + logical operation;
[0040] In the formula, key represents the encrypted ciphertext after the part is split.
[0041] Optionally, the ADB data transmission encryption / decryption method further includes: a detection device.
[0042] When the detection device detects that the adbd device has lost connection with the ADB server, it sends a re-encryption request to the ADB client.
[0043] Optionally, after the step of transmitting data according to the operation instruction upon successful decryption, the adbd device further includes:
[0044] When the adbd device fails to decrypt, it will send the command to close the ADB client to the ADB server.
[0045] The ADB server receives the command to shut down the ADB client and transmits the command to the ADB client.
[0046] The ADB client receives the command to close the ADB client and displays a pop-up window indicating a password error.
[0047] This invention discloses an ADB data transmission encryption and decryption system and method. The system includes: a key generation device, an ADB client, an ADB server, and an adbd device. The key generation device generates an encryption key based on collected device information and transmits the encryption key to the ADB client. The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server. The ADB server receives the encryption key and operation instructions and transmits them to the adbd device. The adbd device receives the encryption key and operation instructions and decrypts the encryption key. Upon successful decryption, the adbd device also transmits data according to the operation instructions. This invention ensures the security of data transmission using ADB by generating a key for ADB encryption via the key generation device, transmitting the encryption key to the adbd device via the ADB client and ADB server, and decrypting the encryption key at the adbd device. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the structure of the first embodiment of the ADB data transmission encryption and decryption system of the present invention;
[0049] Figure 2 This is a flowchart illustrating the first embodiment of the ADB data transmission encryption / decryption method of the present invention;
[0050] Figure 3 This is a flowchart illustrating the key generation process of an embodiment of the ADB data transmission encryption / decryption system of the present invention.
[0051] Figure 4 This is a diagram of the ADB encryption module of an embodiment of the ADB data transmission encryption and decryption system of the present invention;
[0052] Figure 5 This is a diagram of the unencrypted ADB module of an embodiment of the ADB data transmission encryption and decryption system of the present invention;
[0053] Figure 6 This is an encryption flowchart of an embodiment of the ADB data transmission encryption and decryption system of the present invention.
[0054] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0056] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0057] Furthermore, the use of terms such as "first" and "second" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0058] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the first embodiment of the ADB data transmission encryption and decryption system of the present invention, which presents the first embodiment of the ADB data transmission encryption and decryption system of the present invention.
[0059] like Figure 1 As shown, the ADB data transmission encryption and decryption system includes: a key generation device 10, an ADB client 20, an ADB server 30, and an adbd device 40.
[0060] The key generation device 10 is used to generate an encryption key based on the collected device information and transmit the encryption key to the ADB client 20.
[0061] It should be understood that the Android Debug Bridge (ADB) is a tool in the Android SDK, designed to facilitate debugging of devices or developed Android apps. ADB acts as a bridge between Android phones and PCs, allowing users to perform comprehensive operations on their phones from their computers (this tool can directly manage Android emulators or real Android devices). Android's initial intention was to use ADB to assist developers in debugging APKs faster and better during Android application development. Therefore, ADB has functions such as installing and uninstalling APKs (i.e., some applications), copying push files, viewing device hardware information, viewing application resource usage, and executing shell commands on the device (shell commands access the phone's console). Android devices do not encrypt the ADB tool; the console can be accessed directly through developer mode, making it impossible to guarantee the security of using ADB.
[0062] To overcome the above-mentioned defects, this embodiment generates an encryption key on the key generation device side, sends the encryption key to the ADB server 30 through the ADB device side 20, and then the ADB server 30 transmits the encryption key to the adbd device side 40. The adbd device side 40 decrypts the encryption key. Data transmission can only be carried out after successful decryption, thereby ensuring the security of data transmission using ADB.
[0063] As is understandable, ADB consists of three parts: a client, a background process, and a server. The ADB client 20 runs on the development computer and can be invoked from the command-line terminal by issuing adb commands. The background process runs commands as a background process on each emulator or device instance. The ADB server 30 manages the communication between the ADB client 20 and the background process and runs as a background process on the development computer.
[0064] It should be noted that the key generation device 10 generates a key for unlocking the device, such as the device number, in the encryption module based on the device number input by the user. This key is then used to grant permissions to the ADB device console. The encryption key is then sent to the adbd device for decryption via the ADB device.
[0065] Furthermore, in order to ensure the security of data transmission using ADB, the key generation device 10 is also used to encrypt the data based on the collected device information and a preset encryption algorithm to obtain encrypted ciphertext.
[0066] The key generation device 10 is also used to split the encrypted ciphertext and select a portion of the split ciphertext for encryption.
[0067] The key generation device 10 is further configured to generate an encryption key based on the partially split encrypted ciphertext and logical operations, and transmit the encryption key to the ADB client.
[0068] It should be noted that the preset encryption algorithm can be MD5 encryption, and this embodiment does not impose any restrictions. The logical operations can be addition, subtraction, multiplication, division, OR, NAND, and NOT.
[0069] In the specific implementation, the key generation device 10 collects the device number according to the device information collection module, encrypts the device number using the MD5 encryption method, splits the encrypted ciphertext into 8 groups, takes the last bit of data from each group, and performs logical operations on the last bit of data in each group to generate an encryption key.
[0070] For ease of understanding, please refer to Figure 3 To explain, Figure 3 The flowchart shows the key generation process. In the flowchart, the key generation device 10 collects device information according to the device information collection module, encrypts the collected device information using MD5, splits the encrypted ciphertext, and performs logical operations on the split encrypted ciphertext to obtain the encryption key.
[0071] It should be noted that the preset encryption algorithm can be:
[0072] MD5 = GetMD5(data);
[0073] In the formula, data represents device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext.
[0074] It should be noted that the encryption key can be:
[0075] lock_passwd_data = key + logical operation;
[0076] In the formula, key represents the encrypted ciphertext after partial splitting. The key represents the ciphertext after splitting and encrypting, which is divided into 8 groups, and the set is formed by selecting the last bit of data from each group.
[0077] The ADB client 20 is used to receive the encryption key and transmit the encryption key and operation instructions to the ADB server 30.
[0078] Understandably, the ADB client 20 is installed on the PC and transmits data with the ADB server 30 via the TCP protocol.
[0079] It should be noted that the operation instructions transmitted from the ADB client 20 to the ADB server 30 can be shell commands. This embodiment does not limit this. After receiving the encryption key, the ADB client 20 transmits the encryption key and the generated operation instructions to the ADB server 30 via the TCP protocol.
[0080] It should be noted that the ADB client 20 will receive and display information indicating whether the decryption was successful or failed from the adbd device 40.
[0081] The ADB server 30 is used to receive the encryption key and the operation instruction, and transmit the encryption key and the operation instruction to the adbd device 40.
[0082] It should be noted that the ADB server 30 can connect to the adbd device 40 via TCP or USB.
[0083] Understandably, the ADB server 30 will also transmit information about whether the decryption by the adbd device 40 was successful or failed to the ADB client 20, and will also transmit the corresponding instructions for successful decryption or failure to the ADB client 20.
[0084] The adbd device terminal 40 is used to receive the encryption key and the operation command, and to decrypt the encryption key.
[0085] It should be noted that the adbd device side 40 can be the ADB Daemon program, which is applied on the device running the Android system and is used by the ADB Daemon program to decrypt the encryption key.
[0086] Understandably, after successfully decrypting the encryption key, the adbd device 40 will start the corresponding service according to the operation instructions.
[0087] The adbd device terminal 40 is also used to transmit data according to the operation instructions when decryption is successful.
[0088] It should be noted that after successful decryption, the adbd device 40 will open the console or perform operations such as deleting applications, downloading applications, and initializing the device according to the operation instructions. The above operation data will then be transmitted to the ADB server 30, and the ADB server 30 will transmit it to the ADB client 20 for display.
[0089] Furthermore, in order to improve the security of using the ADB device, the adbd device 40 is also used to transmit a command to close the ADB client to the ADB server 30 when decryption fails;
[0090] The ADB server 30 is also configured to receive the command to close the ADB client and transmit the command to close the ADB client 20;
[0091] The ADB client 20 is also used to receive the command to close the ADB client and to display a pop-up window indicating a password error.
[0092] Understandably, when the adbd device 40 fails to unlock with a password, either an incorrect password or an incorrect command will be returned to the ADB client 20 and displayed on the PC, with a pop-up message indicating an incorrect password or command. This will prevent the activation of some critical commands, such as accessing the console or transferring files. Once the adbd device 40 successfully completes password verification, these commands will be enabled, allowing the user to use the ADB application normally.
[0093] Furthermore, to enhance the security of using ADB devices, the ADB data transmission encryption and decryption system further includes: a detection device end 50;
[0094] The detection device 50 is used to send a re-encryption request to the ADB client 20 when it detects that the adbd device 40 has lost connection with the ADB server 30.
[0095] It should be noted that when the detection device 50 detects that the device is powered off or the USB connection between the ADB server 30 and the adbd device 40 is disconnected, it sends a re-encryption request to the ADB client 20. The next time the ADB application is used, it needs to be decrypted again.
[0096] For ease of understanding, please refer to Figure 4 To explain, Figure 4 Diagram of the ADB encryption module. Figure 4 The device information acquisition module of the key generation device 10 generates an encryption key and transmits the encryption key to the ADB client 20. After receiving the encryption key, the ADB client 20 transmits the encryption key and operation instructions to the ADB server 30. The ADB server 30 transmits the encryption key and operation instructions to the adbd device 40, which decrypts the encryption key.
[0097] Understandably, this is to create a contrast. Figure 5 This is a diagram of the unencrypted ADB module. Figure 5 The ADB client 10 transmits the operation instructions to the ADB server 30, which in turn transmits the operation instructions to the adbd device 40, which then directly starts the service based on the operation instructions.
[0098] Understandably, according to Figure 4 and Figure 5 As can be seen, if ADB is not encrypted, the console can be opened simply through developer mode. However, this embodiment encrypts the use of ADB tools, preventing malicious damage to device information and improving device security.
[0099] For ease of understanding, please refer to Figure 6 To explain, Figure 6 The flowchart illustrates the encryption process. Device 10 (key generation) transmits the encryption key to ADB client 20. ADB client 20 then transmits the encryption key and operation instructions to ADB server 30. ADB server 30 transmits these same instructions to adbd device 40. Adbd device 40 decrypts the encryption key. Successful or failed decryption results in the corresponding ADB enable or disable command being transmitted to ADB server 30, which then transmits the command back to ADB client 20 for display. Simultaneously, after successful decryption, ADB client 20, ADB server 30, and adbd device 40 perform normal data transmission. Furthermore, when detection device 50 detects that the device is powered off or the USB connection between ADB server 30 and adbd device 40 is disconnected, it sends a re-encryption request to ADB client 20. The next time the ADB application is used, decryption must be performed again.
[0100] This embodiment includes: a key generation device, an ADB client, an ADB server, and an adbd device. The key generation device generates an encryption key based on collected device information and transmits the encryption key to the ADB client. The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server. The ADB server receives the encryption key and operation instructions and transmits them to the adbd device. The adbd device receives the encryption key and operation instructions and decrypts the encryption key. Upon successful decryption, the adbd device also transmits data according to the operation instructions. This embodiment generates a key for ADB encryption using the key generation device, transmits the encryption key to the adbd device via the ADB client and ADB server, and decrypts the encryption key on the adbd device, thereby ensuring the security of data transmission using ADB.
[0101] Furthermore, embodiments of the present invention also propose an ADB data transmission encryption and decryption method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the ADB data transmission encryption and decryption method of the present invention, which presents the first embodiment of the ADB data transmission encryption and decryption method of the present invention.
[0102] Step S10 is used to generate an encryption key based on the collected device information and transmit the encryption key to the ADB client.
[0103] It should be understood that the Android Debug Bridge (ADB) is a tool in the Android SDK, designed to facilitate debugging of devices or developed Android apps. ADB acts as a bridge between Android phones and PCs, allowing users to perform comprehensive operations on their phones from their computers (this tool can directly manage Android emulators or real Android devices). Android's initial intention was to use ADB to assist developers in debugging APKs faster and better during Android application development. Therefore, ADB has functions such as installing and uninstalling APKs (i.e., some applications), copying push files, viewing device hardware information, viewing application resource usage, and executing shell commands on the device (shell commands access the phone's console). Android devices do not encrypt the ADB tool; the console can be accessed directly through developer mode, making it impossible to guarantee the security of using ADB.
[0104] To overcome the above-mentioned defects, this embodiment generates an encryption key on the key generation device side, sends the encryption key to the ADB server through the ADB device side, and the ADB server then transmits the encryption key to the adbd device side. The adbd device side decrypts the encryption key, and data transmission can only be carried out after successful decryption, thereby ensuring the security of data transmission using ADB.
[0105] As is understandable, ADB consists of three parts: the client, the background process, and the server. The ADB client runs on the development computer and can be invoked from the command-line terminal by issuing adb commands. The background process runs commands as a background process on each emulator or device instance. The ADB server component manages the communication between the ADB client and the background process, and the ADB server runs as a background process on the development computer.
[0106] It should be noted that the key generation device generates a key for unlocking the device, such as the device number, in the encryption module based on the user-input device number. This key is then used to grant permissions to the ADB device console. The encryption key is then sent from the ADB device to the adbd device for decryption.
[0107] Furthermore, to ensure the security of data transmission using ADB, step S10 of this embodiment may include:
[0108] The key generation device encrypts the collected device information and a preset encryption algorithm to obtain encrypted ciphertext.
[0109] The key generation device splits the encrypted ciphertext and selects a portion of the split ciphertext for encryption.
[0110] The key generation device generates an encryption key based on the partially split encrypted ciphertext and logical operations, and transmits the encryption key to the ADB client.
[0111] It should be noted that the preset encryption algorithm can be MD5 encryption, and this embodiment does not impose any restrictions. The logical operations can be addition, subtraction, multiplication, division, OR, NAND, and NOT.
[0112] In the specific implementation, the key generation device collects the device number according to the device information collection module, encrypts the device number using the MD5 encryption method, splits the encrypted ciphertext into 8 groups, takes the last bit of data from each group, and performs logical operations on the last bit of data in each group to generate the encryption key.
[0113] For ease of understanding, please refer to Figure 3 To explain, Figure 3 The flowchart shows the key generation process. In the flowchart, the key generation device collects device information from the device information acquisition module, encrypts the collected device information using MD5, splits the encrypted ciphertext, and performs logical operations on the split encrypted ciphertext to obtain the encryption key.
[0114] It should be noted that the preset encryption algorithm can be:
[0115] MD5 = GetMD5(data);
[0116] In the formula, data represents device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext.
[0117] It should be noted that the encryption key can be:
[0118] lock_passwd_data = key + logical operation;
[0119] In the formula, key represents the encrypted ciphertext after partial splitting. The key represents the ciphertext after splitting and encrypting, which is divided into 8 groups, and the set is formed by selecting the last bit of data from each group.
[0120] Step S20: The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server.
[0121] It is understandable that the ADB client is installed on the PC and transmits data with the ADB server via the TCP protocol.
[0122] It should be noted that the operation instructions transmitted from the ADB client to the ADB server can be shell commands, and this embodiment does not limit this. After receiving the encryption key, the ADB client transmits the encryption key and the generated operation instructions to the ADB server via the TCP protocol.
[0123] It should be noted that the ADB client will receive and display information indicating whether the decryption on the adbd device was successful or failed.
[0124] Step S30: The ADB server receives the encryption key and the operation instruction, and transmits the encryption key and the operation instruction to the adbd device.
[0125] It should be noted that the ADB server can connect to the adbd device via TCP or USB.
[0126] Understandably, the ADB server will also transmit information about whether the adbd device decryption was successful or failed to the ADB client, as well as the corresponding command for successful decryption or command for failed decryption to the ADB client.
[0127] Step S40: The adbd device receives the encryption key and the operation command, and decrypts the encryption key.
[0128] It should be noted that the adbd device side can be the ADB Daemon program, which is applied on the device running the Android system, and the ADB Daemon program decrypts the encryption key.
[0129] Understandably, after successfully decrypting the encryption key, the adbd device will start the corresponding service according to the operation instructions.
[0130] Step S50: The adbd device: upon successful decryption, performs data transmission according to the operation instructions.
[0131] It should be noted that after successful decryption, the adbd device will open the console or perform operations such as deleting applications, downloading applications, and initializing the device according to the operation instructions. The above operation data is then transmitted to the ADB server, and the ADB server transmits it to the ADB client for display.
[0132] Furthermore, to improve the security of using ADB devices, step S50 may further include:
[0133] When the adbd device fails to decrypt, it will send the command to close the ADB client to the ADB server.
[0134] The ADB server receives the command to shut down the ADB client and transmits the command to the ADB client.
[0135] The ADB client receives the command to close the ADB client and displays a pop-up window indicating a password error.
[0136] Understandably, when the adbd device fails to unlock with a password, errors in the password or command will be returned to the ADB client and displayed on the PC, with a pop-up message indicating an incorrect password or command. This will prevent the activation of some critical commands, such as accessing the console or transferring files. Once the adbd device successfully completes password verification, these commands will be enabled, allowing the user to use the ADB application normally.
[0137] Furthermore, to enhance the security of using ADB devices, the ADB data transmission encryption and decryption method further includes: detecting the device end;
[0138] When the detection device detects that the adbd device has lost connection with the ADB server, it sends a re-encryption request to the ADB client.
[0139] It should be noted that when the detection device detects that the device is powered off or the USB connection between the ADB server and the adbd device is disconnected, it sends a re-encryption request to the ADB client. The next time the ADB application is used, it needs to be decrypted again.
[0140] Understandable, Figure 4 The device generates an encryption key based on the device information acquisition module on the key generation device side, and transmits the encryption key to the ADB client. After receiving the encryption key, the ADB client transmits the encryption key and operation instructions to the ADB server. The ADB server transmits the encryption key and operation instructions to the adbd device side, and the adbd device side decrypts the encryption key.
[0141] Understandably, this is to create a contrast. Figure 5 The ADB client transmits operation commands to the ADB server, which then transmits the operation commands to the adbd device, which directly starts the service based on the operation commands.
[0142] Understandably, according to Figure 4 and Figure 5As can be seen, if ADB is not encrypted, the console can be opened simply through developer mode. However, this embodiment encrypts the use of ADB tools, preventing malicious damage to device information and improving device security.
[0143] For ease of understanding, Figure 6 The encryption key generation device transmits the encryption key to the ADB client. The ADB client then transmits the encryption key and operation commands to the ADB server. The ADB server transmits the encryption key and operation commands to the adbd device. The adbd device decrypts the encryption key. Successful or failed decryption results in the corresponding ADB enable or disable command being transmitted to the ADB server, which then transmits the ADB enable or disable command back to the ADB client for display. Simultaneously, after successful decryption, the ADB client, ADB server, and adbd device maintain normal data transmission. Furthermore, when the detection device detects that the device is powered off or the USB connection between the ADB server and the adbd device is disconnected, it sends a re-encryption request to the ADB client. The next time the ADB application is used, decryption must be performed again.
[0144] This embodiment includes: a key generation device, an ADB client, an ADB server, and an adbd device. The key generation device generates an encryption key based on collected device information and transmits the encryption key to the ADB client. The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server. The ADB server receives the encryption key and operation instructions and transmits them to the adbd device. The adbd device receives the encryption key and operation instructions and decrypts the encryption key. Upon successful decryption, the adbd device also transmits data according to the operation instructions. This embodiment generates a key for ADB encryption using the key generation device, transmits the encryption key to the adbd device via the ADB client and ADB server, and decrypts the encryption key on the adbd device, thereby ensuring the security of data transmission using ADB.
[0145] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0146] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0147] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An Android Debug Bridge (ADB) data transmission encryption and decryption system, characterized in that, The ADB data transmission encryption and decryption system includes: a key generation device, an ADB client, an ADB server, and an Android debug bridge daemon process (adbd) device. The key generation device is used to generate an encryption key based on the collected device information and transmit the encryption key to the ADB client; The ADB client is used to receive the encryption key and transmit the encryption key and operation instructions to the ADB server; The ADB server is used to receive the encryption key and the operation instruction, and to transmit the encryption key and the operation instruction to the adbd device. The adbd device is used to receive the encryption key and the operation command, and to decrypt the encryption key; The adbd device is also used to transmit data according to the operation instructions when decryption is successful; The key generation device is also used to encrypt the collected device information and a preset encryption algorithm to obtain encrypted ciphertext. The key generation device is also used to split the encrypted ciphertext and select a portion of the split ciphertext for encryption. The key generation device is also used to generate an encryption key based on the partially split encrypted ciphertext and logical operations, and transmit the encryption key to the ADB client.
2. The ADB data transmission encryption and decryption system of claim 1, wherein, The preset encryption algorithm is specifically as follows: MD5 = GetMD5(data); In the formula, data represents the device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext; Furthermore, the encryption key is specifically: lock_passwd_data = key + logical operation; In the formula, key represents the encrypted ciphertext after partial splitting, and lock_passwd_data represents the encryption key generated based on the encrypted ciphertext after partial splitting and logical operations.
3. The ADB data transmission encryption and decryption system as described in claim 1, characterized in that, The ADB data transmission encryption and decryption system also includes: a detection device; The detection device is used to send a re-encryption request to the ADB client when it detects that the adbd device has lost connection with the ADB server.
4. The ADB data transmission encryption and decryption system as described in claim 1, characterized in that, The adbd device is also used to transmit a command to close the ADB client to the ADB server when decryption fails. The ADB server is also configured to receive the command to shut down the ADB client and transmit the command to the ADB client. The ADB client is also used to receive the command to close the ADB client and to display a pop-up window indicating a password error.
5. A method for encrypting and decrypting ADB data transmission in an Android debug bridge, characterized in that, The ADB data transmission encryption and decryption method is applied to an ADB data transmission encryption and decryption system, which includes: a key generation device, an ADB client, an ADB server, and an Android debug bridge daemon process (adbd) device. The key generation device generates an encryption key based on the collected device information and transmits the encryption key to the ADB client; The ADB client receives the encryption key and transmits the encryption key and operation instructions to the ADB server; The ADB server receives the encryption key and the operation instruction, and transmits the encryption key and the operation instruction to the adbd device. The adbd device receives the encryption key and the operation command, and decrypts the encryption key; When the adbd device successfully decrypts, it transmits data according to the operation command. The step of generating an encryption key based on the collected device information and transmitting the encryption key to the ADB client includes: The key generation device encrypts the collected device information and a preset encryption algorithm to obtain encrypted ciphertext. The key generation device splits the encrypted ciphertext and selects a portion of the split ciphertext for encryption. The key generation device generates an encryption key based on the partially split encrypted ciphertext and logical operations, and transmits the encryption key to the ADB client.
6. The ADB data transmission encryption and decryption method as described in claim 5, characterized in that, The preset encryption algorithm is specifically as follows: MD5 = GetMD5(data); In the formula, data represents the device information, GetMD5() represents the preset encryption algorithm, and MD5 represents the encrypted ciphertext; Furthermore, the encryption key is specifically: lock_passwd_data = key + logical operation; In the formula, key represents the encrypted ciphertext after partial splitting, and lock_passwd_data represents the encryption key generated based on the encrypted ciphertext after partial splitting and logical operations.
7. The ADB data transmission encryption and decryption method as described in claim 5, characterized in that, The ADB data transmission encryption and decryption method further includes: a detection device; When the detection device detects that the adbd device has lost connection with the ADB server, it sends a re-encryption request to the ADB client.
8. The ADB data transmission encryption and decryption method as described in claim 5, characterized in that, After the step of transmitting data according to the operation command when the adbd device successfully decrypts, the method further includes: When the adbd device fails to decrypt, it will send the command to close the ADB client to the ADB server. The ADB server receives the command to shut down the ADB client and transmits the command to the ADB client. The ADB client receives the command to close the ADB client and displays a pop-up window indicating a password error.