A mobile terminal operating system information protection method based on hardware certificate
By employing an asymmetric encryption algorithm based on hardware certificates in the mobile terminal operating system, utilizing the public keys of the boot and recovery partitions for decryption and verification, and combining the IMEI as the read/write key for the kernel integrity file, the security threats to the mobile terminal operating system are resolved, and the security protection of system files is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-02
- Publication Date
- 2026-03-24
AI Technical Summary
Mobile terminal operating systems are vulnerable to security threats such as rooting, SO injection, installation of the Xposed framework, and injection of Trojans into APP applications. There are also risks of application cloning, information tampering, and theft.
It employs an asymmetric encryption algorithm based on hardware certificates, using public keys from the boot and recovery partitions for decryption and verification to ensure the integrity of the system partitions. The IMEI is used as the read/write key for the kernel integrity file to encrypt and verify system files.
It effectively prevents system file tampering and theft, avoids ROOT and Xposed framework installation, prevents APP repackaging and Trojan injection, ensures system files are read-only, and solves the security problems of mobile terminal operating systems.
Smart Images

Figure CN117828603B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of encryption protection, in particular to a mobile terminal operating system information protection method based on hardware certificate. BACKGROUND
[0002] The current mobile terminal has a very high popularity rate, and the mobile terminal brings higher efficiency, richer experience and more fun to the work, life and entertainment of users. At present, as the main representative product of mobile terminal, the initial design of the operating system (including Android and IOS) of smart phone is a life consumer product, which does not focus on the needs of users (especially business users) for security, stability and customized development at the beginning of design, especially the openness of the original code of Android system exposes other users to the threat of malicious users. In addition, due to system design and other reasons, there are a large number of un-repaired security bugs in the release versions of IOS and Android.
[0003] Specifically, the main security threats faced by the mobile terminal operating system are as follows:
[0004] (1) Application obtains ROOT permission: since the Android open source is used by malicious users, the code can be fully researched for security vulnerabilities, so there are a large number of ROOT solutions for Android, which can obtain system permission without flashing the system, and when malicious users obtain the highest system permission, they can threaten the system through injection, fraud, tampering and theft.
[0005] IOS system also has this problem, and there are several vulnerabilities in the historical versions of IOS that can obtain system ROOT permission by jailbreaking.
[0006] (2) XPOSED framework and APP container: Xposed framework is an open source framework service running in Android high permission mode, which can affect the program running (modify the system) without modifying the file. Based on it, many powerful modules can be made, and they can work simultaneously without conflict. Using the HOOK component of XPOSED, the parameter return value of any function can be easily obtained and tampered. APK
[0007] Virtual APP is a well-known framework of APP container, and using Virtual APP framework, malicious users can easily make any application run in the memory of Virtual APP, so as to realize unlimited manipulation of any application and interception and tampering of information.
[0008] (3) Application cloning vulnerability: Application cloning means cloning an APP on someone else's phone, and the cloner can easily obtain account permissions and steal user accounts and funds, which sounds terrible, but such an "application cloning" attack model already exists, and the vulnerability discovered this time involves at least one-tenth of the APPs in the domestic Android application market, and is basically represented by mainstream APPs such as ordering food and traveling. In the eyes of users, these APPs may be mature and not worry about security risks, but often things do not go as planned.
[0009] A laboratory demonstrated the effect of "application cloning" attack using a certain APP as an example: on a phone upgraded to the latest Android 8.1.0, using its own vulnerability, the "attacker" sends a malicious link to the user's mobile phone message, and once the user clicks on it, the account is "cloned" to the "attacker's" phone in one second, and then the "attacker" can view user information at will, and can directly operate the application to steal private information, steal accounts and funds, etc. However, the laboratory director said that the "application cloning" vulnerability discovered this time only targets the Android system.
[0010] It is understood that based on this attack model, the laboratory checks a certain security problem that is often overlooked by manufacturers, and finds that 27 of the 200 mobile applications have vulnerabilities, with a proportion of more than 10%.
[0011] (4) Application information fraud: By tampering with information in the client or network pipeline, security incidents can occur, such as the following two ways of tampering with two-dimensional code payment to steal funds:
[0012] a. Tamper with the two-dimensional code, such as Figure 1 ;
[0013] b. Tamper with transaction data, such as Figure 2 .
[0014] (5) Process injection and information theft: malicious code can be injected into the current process in various ways, such as IOS Cordova plug-in; for example, in Android, ptrace, Xposed can also be used to steal payment codes, such as Figure 3 . SUMMARY
[0015] The purpose of the present application is to overcome the shortcomings and deficiencies of the prior art, and to provide a mobile terminal operating system information protection method based on hardware certificates, which eliminates the risk of tampering and theft of existing mobile terminal operating system files, and solves the problems of existing systems being easily rooted, SO injection, installing xposed framework, and APP application end being injected with Trojan horses.
[0016] The purpose of the present application is achieved by the following technical solutions:
[0017] A mobile terminal operating system information protection method based on hardware certificate, comprising the following steps:
[0018] S1, the mobile terminal operating system reads the public key in the recovery partition when starting through the boot partition;
[0019] S2, the mobile terminal operating system reads the public key in the boot partition when starting through the recovery partition;
[0020] S3, after the mobile terminal operating system starts through the boot partition, the public key in the kernel of the partition is added to the public key existing in the kernel of the recovery partition to verify the system partition;
[0021] S4, after the mobile terminal operating system starts through the recovery partition, the public key in the kernel of the partition is added to the public key existing in the boot partition to verify the system partition;
[0022] S5, when the system integrity fingerprint verification fails, the start is exited and the power is turned off.
[0023] In step S1, when the mobile terminal operating system starts using boot, after completing kernel loading, the recovery partition is decrypted by reading the public key file b.cer in the kernel of the boot partition, and the encrypted part of the boot partition is decrypted by reading the public key file r.cer in the kernel of the recovery partition. After decryption, the decrypted file is verified by the public key b.cer in the kernel; if the verification fails, the start fails.
[0024] In step S2, when the mobile terminal operating system starts using recovery, after completing kernel loading, the boot partition is decrypted by reading the public key file r.cer in the kernel of the recovery partition and verifying the integrity, and the encrypted part of the recovery partition is decrypted by reading the public key file b.cer in the kernel of the boot partition. After decryption, the decrypted file is verified by the public key r.cer in the kernel; if the verification fails, the start fails.
[0025] The step S3 specifically comprises the following steps:
[0026] S301: after the mobile terminal operating system starts through the boot partition, the system integrity key C and the decrypted key combination A are read and verified in the partition;
[0027] S302: the recovery partition is decrypted by reading the public key b.cer in the kernel of the boot partition, the system integrity key D and the decrypted key combination B are read and verified;
[0028] S303: Obtain the system decryption key A+B, and check the integrity key C;
[0029] S304: Decrypt the read system partition startup into the system by the decryption key A+B, and check the system partition integrity by the integrity key C;
[0030] S305: If the decryption key A+B cannot decrypt the system, exit the system;
[0031] S306: If the integrity key D fails to check, exit the startup.
[0032] The step S4 specifically comprises the following steps:
[0033] S401: After the mobile terminal operating system is started by the recovery partition, read the system integrity key D and the decrypted key combination B in the area;
[0034] S402: The public key r.cer in the recovery partition kernel decrypts the read boot partition, reads the system integrity key C and the decrypted key combination A;
[0035] S403: Obtain the system decryption key A+B, and check the integrity key D;
[0036] S404: Decrypt the read system partition by the decryption key A+B, and check the system partition integrity by the integrity key D;
[0037] S405: If the decryption key A+B cannot decrypt, the system partition exits the system;
[0038] S406: If the integrity key D fails to check, exit the startup.
[0039] The method further comprises the following steps:
[0040] The hardware first loads the mobile terminal operating system, and needs to be encrypted and initialized using the mobile terminal IMEI as the read-write key of the kernel integrity file.
[0041] The encryption initialization uses the mobile terminal IMEI as the read-write key of the kernel integrity file, and specifically comprises the following steps:
[0042] S601: Start the system to encrypt the system partition using an asymmetric encryption algorithm, encrypt the system partition, and divide the private key into two parts;
[0043] S602: Divide the private key into two parts A and B, and store them in the boot partition and the recovery partition, respectively;
[0044] S603: encrypt the boot partition and the recovery partition using an asymmetric encryption algorithm, the private key is not public, and the read key is stored in the unencrypted kernel part.
[0045] Meanwhile, the present application provides:
[0046] A server, comprising a processor and a memory, at least one program is stored in the memory, the program is loaded and executed by the processor to realize the above-mentioned hardware certificate-based mobile terminal operating system information protection method.
[0047] A computer readable storage medium, at least one program is stored in the storage medium, the program is loaded and executed by the processor to realize the above-mentioned hardware certificate-based mobile terminal operating system information protection method.
[0048] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0049] 1. The present application uses the method of encrypting the boot partition and the system partition by using an asymmetric encryption algorithm to ensure that the mobile operating system file and the running environment are not tampered with and stolen, and to realize security protection. Since the mobile terminal only has a decryption algorithm, the core boot\recovery\system partition of the mobile terminal is in an unmodifiable state.
[0050] 2. The present application adopts an open architecture, which is convenient for secondary development.
[0051] 3. The present application can avoid repackaging and Trojan horse of the mobile terminal APP.
[0052] 4. The present application can avoid theft and modification of the mobile operating system file.
[0053] 5. The present application can avoid ROOT of the mobile operating system, installation of third-party boot system, and installation of XPOSED and other third-party frameworks.
[0054] 6. The local system file of the present application is in a read-only state, and the user cannot modify it, so all the above problems are perfectly solved. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 is a schematic diagram of tampering with the two-dimensional code mode;
[0056] Figure 2 is a schematic diagram of tampering with transaction data mode;
[0057] Figure 3 is a schematic diagram of ptrace, Xposed stealing payment code principle;
[0058] Figure 4 Partition diagram of Android mobile phone
[0059] Figure 5 is a structural diagram of the mobile terminal operating system partition of the present application;
[0060] Figure 6 is a flow chart of the boot start of the mobile terminal operating system of the present application;
[0061] Figure 7 is a flow chart of the start recovery mode of the mobile terminal operating system of the present application. DETAILED DESCRIPTION
[0062] The present application will be further described in conjunction with the embodiments and the accompanying drawings, but the embodiments of the present application are not limited thereto.
[0063] As Figures 4 to 7 A mobile terminal operating system information protection method based on hardware certificate, comprising the following steps:
[0064] S1, the mobile terminal operating system reads the public key in the recovery partition when starting through the boot partition;
[0065] When the mobile terminal operating system starts using boot, after completing kernel loading, it will decrypt and read the recovery partition through the public key file b.cer in the kernel of the boot partition, and decrypt and read the encrypted part of the boot partition through the public key file r.cer in the kernel of the recovery partition, and then check the decrypted file with the public key b.cer in the kernel; if the check fails, the start fails.
[0066] S2, the mobile terminal operating system reads the public key in the boot partition when starting through the recovery partition;
[0067] When the mobile terminal operating system starts using recovery, after completing kernel loading, it will decrypt the boot partition through the public key file r.cer in the kernel of the recovery partition and check the integrity, and decrypt and read the encrypted part of the recovery partition through the public key file b.cer in the kernel of the boot partition, and then check the decrypted and read file with the public key r.cer in the kernel; if the check fails, the start fails.
[0068] S3, after the mobile terminal operating system starts through the boot partition, the public key in the kernel of the present partition is used to check the system partition together with the public key existing in the kernel of the recovery partition;
[0069] Specifically comprising the following steps:
[0070] S301: After the mobile terminal operating system is started through the boot partition, the system integrity key C and the decrypted key combination A are read;
[0071] S302: The recovery partition is read through the public key b.cer in the kernel of the boot partition, the system integrity key D and the decrypted key combination B are read;
[0072] S303: The system decryption key A+B is obtained, and the integrity key C is checked;
[0073] S304: The system partition is read through the decryption key A+B, and the system partition integrity is checked through the integrity key C;
[0074] S305: If the system cannot be decrypted through the decryption key A+B, the system is exited;
[0075] S306: If the integrity key D fails to be checked, the start is exited.
[0076] S4: After the mobile terminal operating system is started through the recovery partition, the public key in the kernel of the partition is used to check the system partition together with the public key existing in the boot partition;
[0077] Specifically, the following steps are included:
[0078] S401: After the mobile terminal operating system is started through the recovery partition, the system integrity key D and the decrypted key combination B are read;
[0079] S402: The boot partition is read through the public key r.cer in the kernel of the recovery partition, the system integrity key C and the decrypted key combination A are read;
[0080] S403: The system decryption key A+B is obtained, and the integrity key D is checked;
[0081] S404: The system partition is read through the decryption key A+B, and the system partition integrity is checked through the integrity key D;
[0082] S405: If the system cannot be decrypted through the decryption key A+B, the system partition is exited;
[0083] S406: If the integrity key D fails to be checked, the start is exited.
[0084] S5: When the system integrity fingerprint fails to be checked, the start is exited, and the mobile terminal is shut down.
[0085] The method further comprises the following steps:
[0086] The hardware first loads the mobile terminal operating system, and needs to be encrypted and initialized using the mobile terminal IMEI as a read-write key of a kernel integrity file.
[0087] The encryption initialization uses the mobile terminal IMEI as a read-write key of a kernel integrity file, and specifically comprises the following steps:
[0088] S601: The system is started to encrypt the system partition using an asymmetric encryption algorithm, the system partition is encrypted, and the private key is divided into two parts;
[0089] S602: The private key is divided into two parts A and B, and is stored in the boot partition and the recovery partition, respectively;
[0090] S603: The boot partition and the recovery partition are encrypted using an asymmetric encryption algorithm, the private key is not public, and the read key is stored in the unencrypted kernel part.
[0091] Meanwhile, the present application provides:
[0092] A server, comprising a processor and a memory, at least one program is stored in the memory, the program is loaded and executed by the processor to realize the above-mentioned mobile terminal operating system information protection method based on hardware certificate.
[0093] A computer readable storage medium, at least one program is stored in the storage medium, the program is loaded and executed by the processor to realize the above-mentioned mobile terminal operating system information protection method based on hardware certificate.
[0094] Normal start-up process, as shown in Figure 6 .
[0095] Bootloader boot system loads the kernel in the boot partition, reads the b.cer file in the boot partition kernel, reads the encrypted part of the recovery partition through b.cer, reads the decryption key B. The encrypted part of the boot partition is read through r.cer in the recovery partition, the decryption key A is read, the boot partition is normally loaded, the system partition is decrypted and loaded through the decryption keys A+B, and the integrity of the system partition is checked by using the key C.
[0096] Recovery mode (recovery) start-up process, as shown in Figure 7 .
[0097] The bootloader booting system loads the kernel in the recovery partition, reads the b.cer file in the kernel in the boot partition. The encrypted part of the recovery partition is read through the b.cer in the boot partition, the recovery partition is normally loaded, and the recovery mode system is entered.
[0098] The mobile terminal can select two modes to start when starting booting: 1. boot booting, normal starting; 2. recovery booting, entering the recovery mode. Since the user can make the mobile terminal load an independent complete third-party operating system by rewriting the recovery booting partition, since the files in the boot partition and the system partition are all normal file systems without encryption, the third-party operating system can easily modify part of the system files to bypass the system security protection mechanism, for example, modifying the ID lock violent cracking mechanism when the system enters, realizing the passwordless violent cracking system entry password, etc. The core of these problems is that malicious users can easily read the system files of the mobile terminal through the above-mentioned way, modify and write back to the system through decompilation, injection, etc., so as to realize the cracking of the security mechanism of the mobile terminal. The present application realizes that malicious users cannot read the system files by modifying part of the system partition, so as to realize the security of the mobile terminal system.
[0099] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited by the above embodiments, and any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present application are equivalent replacement methods and are included in the protection scope of the present application.
Claims
1. A method for protecting mobile terminal operating system information based on hardware certificates, characterized in that, Includes the following steps: S1. The system partition is encrypted using an asymmetric encryption algorithm. When the mobile terminal operating system boots through the boot partition, it reads the public key from the recovery partition. When the mobile terminal operating system boots, after the kernel is loaded, it decrypts and reads the recovery partition using the public key file b.cer in the boot partition kernel, and decrypts and reads the encrypted files in the boot partition using the public key file r.cer in the recovery partition kernel. After decryption, it verifies the decrypted files using the public key b.cer in the kernel; if the verification fails, the boot fails. S2. When the mobile terminal operating system boots through the recovery partition, it reads the public key from the boot partition. When the mobile terminal operating system boots using recovery, after the kernel is loaded, it decrypts the boot partition and verifies its integrity using the public key file r.cer in the recovery partition kernel, and reads the encrypted files in the recovery partition using the public key file b.cer in the boot partition kernel. After decryption, it verifies the read files using the public key r.cer in the kernel; if the verification fails, the boot process fails. S3. After the mobile terminal operating system boots through the boot partition, it will use the public key in the kernel of this partition plus the public key in the kernel of the recovery partition to verify the system partition. S4. After the mobile terminal operating system boots through the recovery partition, it will use the public key in the kernel of this partition plus the public key in the boot partition to verify the system partition. If the S5 system integrity fingerprint verification fails, exit the startup process and shut down the device.
2. The method for protecting mobile terminal operating system information based on hardware certificates according to claim 1, characterized in that, Step S3 specifically includes the following steps: S301: After the mobile terminal operating system boots through the boot partition, it reads the system integrity verification key C and the decryption key combination A from this partition; S302: Decrypt and read the recovery partition using the public key b.cer in the boot partition kernel, and read the system integrity verification key D and the decryption key combination B; S303: Obtain the system decryption key A+B and verify the integrity key C; S304: Decrypt and read the system partition using decryption key A+B to boot into the system, and verify the integrity of the system partition using integrity key C; S305: If the decryption key A+B cannot decrypt the system, then exit the system; S306: If the integrity key D verification fails, exit the startup process.
3. The method for protecting mobile terminal operating system information based on hardware certificates according to claim 1, characterized in that, Step S4 specifically includes the following steps: S401: After the mobile terminal operating system boots through the recovery partition, it reads the system integrity verification key D and the decryption key combination B from this partition. S402: Decrypt and read the boot partition using the public key r.cer in the recovery partition kernel, and read the system integrity verification key C and the decryption key combination A; S403: Obtain the system decryption key A+B and verify the integrity key D; S404: Decrypt and read the system partition using decryption key A+B and verify the integrity of the system partition using integrity key D; S405: If the decryption key A+B cannot decrypt, the system partition will exit the system; S406: If the integrity key D verification fails, exit the startup process.
4. The method for protecting mobile terminal operating system information based on hardware certificates according to claim 1, characterized in that, The method further includes the following steps: When the mobile terminal operating system is first installed on the hardware, encryption initialization is required, using the mobile terminal IMEI as the read / write key for the kernel integrity file.
5. The method for protecting mobile terminal operating system information based on hardware certificates according to claim 4, characterized in that, The encryption initialization uses the mobile terminal IMEI as the read / write key for the kernel integrity file, and specifically includes the following steps: S601: The system starts by encrypting the system partition using an asymmetric encryption algorithm, and the private key is divided into two parts; S602: Divide the private key into two parts, A and B, and store them in the boot partition and recovery partition respectively; S603: Uses an asymmetric encryption algorithm to encrypt the boot partition and recovery partition. The private key is not disclosed, and the read key is stored in the unencrypted kernel part.
6. A server, characterized in that, The server includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the hardware certificate-based mobile terminal operating system information protection method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is loaded and executed by a processor to implement the hardware certificate-based mobile terminal operating system information protection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Secure startup architecture and method for embedded equipment
CN114861191A
Method for upgrading signature firmware, electronic equipment and storage medium
CN115640582A