A log management method and log security system for a vehicle application
By introducing a log encryption library and trust zone key information into the T-BOX to encrypt application logs, the problem of insufficient T-BOX log security is solved, ensuring the security of log information and the stability of vehicle remote control functions.
Patent Information
- Application Number
- CN202210242594.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-03-11
AI Technical Summary
In vehicle-to-everything (V2X) systems, the security of T-BOX application logs cannot be effectively guaranteed, leading to an increased risk of privacy data leakage and T-BOX being hacked.
By introducing a log encryption library into T-BOX, application logs are encrypted using key information in the trusted zone and stored in the first file area. Decryption is performed by a log decryption tool, ensuring the security of log information.
It effectively prevents the application's plaintext logs from being leaked, prevents attackers from snooping on private data, and ensures the normal operation of the vehicle's remote control function.
Smart Images

Figure CN114595206B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicles, in particular to a log management method and a log security system for vehicle applications. BACKGROUND
[0002] In a vehicle, a telematics box (T-BOX) of the vehicle carries the function of intercommunication with a background system / mobile phone application (APP), and can realize the control of the background system / mobile phone application over the vehicle.
[0003] With the continuous improvement of the intelligence and networking of vehicles, the network security risks faced by the Internet of Vehicles are increasingly prominent. The network security of the T-BOX can include hardware security, system security, software security, data security, and communication security.
[0004] Among them, the hardware security can include CAN bus data security, USB communication security, debug port, etc.; the system security can include file system and partition security, operating system security; the software security can include system firmware security, application security; the data security can include network communication key security, log information security, customer privacy security, vehicle operation data security, remote control key security; the communication security includes OTA upgrade program security, network traffic security, remote control command security, NFC command security, etc.
[0005] As a carrier for realizing various functions in the T-BOX, the application logs record the running track of the application. The application logs play an important role in the development process of the developer or in the analysis of vehicle problems after sale, and can be used to confirm whether the application works normally, find out the problem points, and accelerate the development progress and the speed of processing problems after sale.
[0006] In the current Internet of Vehicles system, the security of the T-BOX application logs cannot be ensured, and the application logs can record hidden information. Once the log information is leaked, it will cause the leakage of private data. In addition, the application logs can contain workflow logs, which are easy to guess the T-BOX workflow after being obtained, resulting in the risk of cracking the T-BOX. SUMMARY
[0007] In view of the above problems, a vehicle application log management method and a log security system are proposed to provide a vehicle application log management method and a log security system that overcome the above problems or at least partially solve the above problems, comprising:
[0008] A vehicle application log management method applied to a log security system, the log security system comprising a T-BOX of the vehicle, the T-BOX comprising an application, a trust zone, a log encryption library, and a first file area, the method comprising:
[0009] The log encryption library acquires target log information written through a target interface when detecting that the application calls the target interface of the log encryption library;
[0010] The log encryption library reads key information from the trust zone, wherein the key information is written to the trust zone through a key tool;
[0011] The log encryption library encrypts the target log information according to the key information to obtain encrypted log information;
[0012] The log encryption library writes the encrypted log information to the first file area.
[0013] Optionally, the log encryption library encrypts the target log information according to the key information to obtain encrypted log information, comprising:
[0014] Encrypting the target log information according to the key information to obtain log ciphertext information;
[0015] Base 64 encoding the log ciphertext information to obtain encrypted log information.
[0016] Optionally, before the log encryption library reads the key information from the trust zone, comprising:
[0017] Reading a target variable from the log encryption library;
[0018] According to the target variable, determining whether the log encryption library has key information;
[0019] When it is determined that the log encryption library does not have the key information, performing the step of reading the key information from the trust zone;
[0020] When it is determined that the log encryption library has the key information, performing the step of encrypting the target log information according to the key information.
[0021] Optionally, after the reading of the key information from the trust zone, further comprising:
[0022] The key information is saved as a global variable.
[0023] Optionally, the log security system further comprises a log decryption tool connected with the T-BOX of the vehicle and a second file area, and the method comprises:
[0024] The log decryption tool acquires the encrypted log information from the first file area when detecting that the target user inputs the key information for decrypting the encrypted log in the T-BOX;
[0025] The log decryption tool decrypts the encrypted log information according to the key information to obtain target log information;
[0026] The log decryption tool writes the target log information into the second file area.
[0027] Optionally, the decrypting the encrypted log information according to the key information to obtain target log information comprises:
[0028] Base 64 decoding the encrypted log information to obtain log ciphertext information;
[0029] Decrypting the log ciphertext information according to the decryption key to obtain target log information.
[0030] A log security system of a vehicle, comprising a T-BOX of the vehicle, the T-BOX comprising an application program, a log encryption library, a trust area and a first file area, wherein:
[0031] The application program is configured to call a target interface of the log encryption library to write target log information;
[0032] The log encryption library is configured to acquire the target log information written through the target interface, read a key information from the trust area, encrypt the target log information according to the key information to obtain encrypted log information, and write the encrypted log information into the first file area, wherein the key information is written into the trust area by a key tool;
[0033] The trust area is configured to store the key information;
[0034] The first file area is configured to store the encrypted target log information.
[0035] Optionally, the vehicle security system further comprises a log decryption tool and a second file area, wherein:
[0036] The log decryption tool is used for acquiring the encrypted log information from the first file area when detecting that target user input key information for decrypting the encrypted log in the T-BOX, performing decryption processing on the encrypted log information according to the key information, obtaining target log information, and writing the target log information into a second file area;
[0037] The second file area is used for saving the decrypted target log information.
[0038] A log management device of a vehicle application program is applied to a T-BOX of a vehicle, a log security system of the vehicle, and the log security system comprises the T-BOX of the vehicle, and the T-BOX comprises an application program, a trust area, a log encryption library, and a first file area.
[0039] A target log information acquisition module is configured to acquire target log information written through a target interface of the log encryption library when detecting that the application program calls the target interface of the log encryption library.
[0040] A key information acquisition module is configured to read key information from the trust area, wherein the key information is written into the trust area by a key tool.
[0041] An encryption module is configured to perform encryption processing on the target log information according to the key information to obtain encrypted log information.
[0042] A first writing module is configured to write the encrypted log information into the first file area by the log encryption library.
[0043] A vehicle comprises a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and the computer program is executed by the processor to implement the log management method of the vehicle application program.
[0044] Embodiments of the present application have the following advantages:
[0045] In the embodiments of the present application, the log management method comprises that the log encryption library acquires target log information written through a target interface of the log encryption library when detecting that the application program calls the target interface of the log encryption library, and reads key information from the trust area, wherein the key information is written into the trust area by a key tool; and performs encryption processing on the target log information according to the key information to obtain encrypted log information, and writes the encrypted target log information into the first file area, thereby realizing encryption processing on the log in the application program, effectively preventing the application program plaintext log from being leaked, and preventing an attacker from spying on application program private data through the log. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those skilled in the art without creative labor on the basis of these drawings also belong to the protection scope of the present application.
[0047] Figure 1 is a step flow chart of a log management method of a vehicle application program provided by an embodiment of the present application;
[0048] Figure 2 is a step flow chart of another log management method of a vehicle application program provided by an embodiment of the present application;
[0049] Figure 3 is a step flow chart of another log management method of a vehicle application program provided by an embodiment of the present application;
[0050] Figure 4a is a structure diagram of a vehicle log security system provided by an embodiment of the present application;
[0051] Figure 4b is a log encryption flow chart provided by an embodiment of the present application;
[0052] Figure 4c is a log decryption flow chart provided by an embodiment of the present application;
[0053] Figure 5 is a structure diagram of a log management device of a vehicle application program provided by an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor also belong to the protection scope of the present application.
[0055] Referring to Figure 1 , a step flow chart of a log management method of a vehicle application program provided by an embodiment of the present application is shown, which is applied to a log security system of a vehicle, the log security system of the vehicle includes a T-BOX of the vehicle, the T-BOX of the vehicle includes an application program, a trust zone, a log encryption library, a first file area, and the method can specifically include the following steps:
[0056] In step 101, the log encryption library acquires target log information written through the target interface when detecting that the application program calls the target interface of the log encryption library.
[0057] The T-BOX of the vehicle is closely related to the remote control function of the vehicle. By encrypting the application program log, the security of the application program log can be ensured, and the T-BOX can also be prevented from being cracked to ensure the normal operation of the remote control function of the vehicle.
[0058] In actual application, different components can be set in the T-BOX, and the different components cooperate with each other to realize encryption or decryption processing of the application program log. Specifically, the T-BOX of the vehicle can include an application program, a trust zone, a log encryption library, and a first file area. The log encryption library can include a target interface.
[0059] The application program can call the target interface of the log encryption library to write a log. When the log encryption library detects that the application program calls the target interface, the log encryption library can acquire target log information written through the target interface. The target log information can be plaintext log information, which is easy to cause data leakage. Therefore, the log encryption library can further process the target log information after acquiring the target log information to ensure the security of the target log information.
[0060] In step 102, the log encryption library reads key information from the trust zone. The key information is written into the trust zone by a key tool.
[0061] When the T-BOX of the vehicle is shipped, the key information can be written into the trust zone of the T-BOX in advance by a key tool. The key information can be used to encrypt the target log information.
[0062] In an example, the key information can be an Advanced Encryption Standard (AES) key, such as a 16-bit AES key. It should be noted that in the embodiments of the present application, the key information can also be other symmetric encryption algorithm key information that can be used to encrypt the log information.
[0063] After acquiring the target log information, the log encryption library can acquire the preset key information (i.e., the key information written into the trust zone by the key tool) from the trust zone to encrypt the target log information by using the key information.
[0064] In an embodiment of the present application, before the log encryption library reads the key information from the trust zone, the following steps are included:
[0065] In step S11, a target variable is read from the log encryption library.
[0066] In actual application, in order to avoid repeated reading of key information, before reading the key information from the trust zone, it can be checked whether the key information has been in the log encryption library, specifically, by reading the target variable in the log encryption library, it can be determined whether the key information has been in the log encryption library.
[0067] Step S12, judging whether the key information has been in the log encryption library according to the target variable;
[0068] After reading the target variable, the target variable can be compared with the preset value of the target variable when the key information has been in the log encryption library, so as to judge whether the key information has been in the log encryption library.
[0069] Specifically, when the read target variable is a global variable, it can be determined that the key information has been in the log encryption library, and when the read target variable is not a global variable, it can be determined that the key information has not been in the log encryption library.
[0070] Step S13, when it is determined that the key information has not been in the log encryption library, the step of reading the key information from the trust zone is performed;
[0071] Step S14, when it is determined that the key information has been in the log encryption library, the step of encrypting the target log information according to the key information is performed.
[0072] In another embodiment of the present application, after the step of reading the key information from the trust zone, it further includes saving the key information as a global variable.
[0073] By saving the key information as a global variable, when the application process calls the library interface to write a log again, it is not necessary to read the key information from the trust zone again, which can improve the efficiency of the encryption process, that is, each application process reads the key information from the trust zone only once in the life cycle.
[0074] Step 103, the log encryption library encrypts the target log information according to the key information to obtain encrypted log information;
[0075] After the log encryption library obtains the key information, the target log information can be encrypted by the key information to obtain encrypted log information, specifically, when the key information is an AES key, the plaintext log information can be encrypted by using the AES encryption algorithm, so that the plaintext log becomes binary encrypted ciphertext.
[0076] By using the key preset in the trust zone for encryption processing, compared with direct encoding encryption, the risk of obtaining the key by attackers through application binary file cracking is avoided, and the security of the application log is effectively ensured.
[0077] In step 104, the log encryption library writes the encrypted log information into the first file area.
[0078] After the target log information is encrypted, the encrypted target log information can be stored in the first file area in a write manner, so that relevant personnel can find the corresponding log from the first file area.
[0079] In the embodiment of the application, when the log encryption library detects that the application program calls the target interface of the log encryption library, the target log information written through the target interface is obtained, and then the key information can be read from the trust zone, wherein the key information is written into the trust zone through the key tool, and the target log information is encrypted according to the key information to obtain encrypted log information, and the encrypted log information is written into the first file area, so that the log in the application program is encrypted, the plaintext log of the application program is effectively prevented from being leaked, the attacker is prevented from spying on the private data of the application program through the log, the security of the application program log is effectively ensured, and the normal operation of the vehicle remote function is ensured.
[0080] Reference Figure 2 , a step flowchart of another log management method of a vehicle application program provided by an embodiment of the application is shown, which is applied to a log security system of a vehicle, the log security system comprising a T-BOX of the vehicle, the T-BOX comprising an application program, a trust zone, a log encryption library, and a first file area, and the method can specifically comprise the following steps:
[0081] In step 201, when the log encryption library detects that the application program calls the target interface of the log encryption library, the target log information written through the target interface is obtained.
[0082] In step 202, the log encryption library reads key information from the trust zone, wherein the key information is written into the trust zone through a key tool.
[0083] In step 203, the target log information is encrypted according to the key information to obtain log ciphertext information.
[0084] After the key information is obtained, the encryption algorithm of the target log information can be determined according to the key information, so that the target log information is encrypted by using the encryption algorithm to obtain the log ciphertext information.
[0085] For example, when the key information is AES key information, the corresponding encryption algorithm is AES encryption algorithm, and then the target log information can be encrypted by using the AES encryption algorithm to obtain binary encrypted ciphertext.
[0086] In step 204, the log ciphertext information is Base 64 encoded to obtain encrypted log information.
[0087] In an example, the encrypted log information can be string information, and after obtaining the encrypted log information, a target character can be added after the encrypted log information, which facilitates the decoding process of the log. For example, when the log needs to be decoded by line, a line feed character can be added after each line of the log, and in the decryption process, the log is decrypted by line according to the line feed character.
[0088] In step 205, the log encryption library writes the encrypted log information to the first file area.
[0089] In the embodiment of the application, when the log encryption library detects that the application program calls the target interface of the log encryption library, the log encryption library obtains the target log information written through the target interface, and then reads the key information from the trust area, wherein the key information is written to the trust area by a key tool, and the target log information is encrypted according to the key information, so that the encrypted target log information is written to the first file area, thereby realizing the encryption processing of the log in the application program, effectively preventing the plaintext log of the application program from being leaked, preventing attackers from spying on the private data of the application program through the log, effectively ensuring the security of the application program log, and further ensuring the normal operation of the vehicle remote function.
[0090] Referring to Figure 3 , a step flowchart of a log management method of a vehicle application program is shown, which is applied to a log security system, the log security system comprising a T-BOX of the vehicle, a log decryption tool connected with the T-BOX of the vehicle, and a second file area, the T-BOX comprising an application program, a trust area, a log encryption library, a first file area, and a second file area, and the decryption method can specifically comprise the following steps:
[0091] In step 301, when the log encryption library detects that the application program calls the target interface of the log encryption library, the log encryption library obtains target log information written through the target interface.
[0092] In step 302, the log encryption library reads key information from the trust area, wherein the key information is written to the trust area by a key tool.
[0093] In step 303, the log encryption library encrypts the target log information according to the key information to obtain encrypted log information.
[0094] In step 304, the log encryption library writes the encrypted log information into the first file area.
[0095] In step 305, the log decryption tool acquires the encrypted log information from the first file area when detecting that the target user inputs the key information for decrypting the encrypted log in the T-BOX.
[0096] When the target log information is encrypted in the log encryption library, the log decryption tool connected with the T-BOX can be used to decrypt the target log information when the user needs to decrypt the target log information.
[0097] The user inputs the key information in the log decryption tool, so that the log decryption tool can acquire the stored encrypted log information from the first file area, and then decrypt the encrypted log information through the log decryption tool.
[0098] In step 306, the log decryption tool decrypts the encrypted log information according to the key information to obtain the target log information.
[0099] The decryption process in the log decryption tool is the corresponding process of the log encryption process.
[0100] In an embodiment of the present application, step 306 includes the following sub-steps:
[0101] In sub-step 3061, the encrypted log information is Base 64 decoded to obtain log ciphertext information.
[0102] In sub-step 3062, the log ciphertext information is decrypted according to the decryption key to obtain the target log information.
[0103] In an example, the encrypted log information can be string information, and after obtaining the encrypted log information, a target character can be added after the encrypted log information, which facilitates the decoding process of the log. For example, when the log needs to be decoded by lines, a line feed character can be added after each line of the written log, and in the decryption process, the log is decrypted by lines according to the line feed character.
[0104] In the decryption process, the log decryption tool can remove the line feed character after acquiring the encrypted log information, and then perform the decryption process.
[0105] In step 307, the log decryption tool writes the target log information into the second file area.
[0106] In the embodiment of the present application, the encrypted log information is encrypted and decrypted, which facilitates the relevant user to safely acquire the log information of the application program, avoids the leakage of the log information, and ensures the security of the log information and the T-BOX.
[0107] Referring to Figure 4a , a structural schematic flow chart of a vehicle log security system is shown, the vehicle log security system comprising a T-BOX of a vehicle, the T-BOX comprising an application program, a log encryption library, a trust zone, and a first file area, and the decryption method can specifically comprise the following steps:
[0108] The application program is configured to call a target interface of the log encryption library to write target log information;
[0109] The log encryption library is configured to obtain the target log information written through the target interface, read key information from the trust zone, perform encryption processing on the target log information according to the key information to obtain encrypted log information, and write the encrypted log information to the first file area, wherein the key information is written to the trust zone through a key tool;
[0110] In an embodiment of the present application, when the log encryption library is configured to perform encryption processing on the target log information according to the key information, it is specifically configured to:
[0111] perform encryption on the target log information according to the key information to obtain log ciphertext information; and perform Base 64 encoding on the log ciphertext information to obtain target string information.
[0112] The trust zone is configured to store key information of the T-BOX;
[0113] The first file area is configured to store the encrypted target log information.
[0114] In an example, the log encryption library is further configured to read a target variable from the log encryption library; determine whether the log encryption library has the key information according to the target variable; when it is determined that the log encryption library does not have the key information, perform the step of reading the key information from the trust zone; and when it is determined that the log encryption library has the key information, perform the step of performing encryption processing on the target log information according to the key information.
[0115] In an embodiment of the present application, the log security system further comprises a log decryption tool and a second file area, wherein:
[0116] The log decryption tool is configured to, when detecting that a target user inputs key information for decrypting encrypted logs in the T-BOX, obtain the encrypted log information from the first file area, perform decryption processing on the encrypted log information according to the key information to obtain target log information, and write the target log information to the second file area.
[0117] The second file area is used for saving the decrypted target log information.
[0118] In an embodiment of the present application, the log encryption library can also be used to save the key information as a global variable.
[0119] The following will be described in combination with Figures 4b-4c The encryption process and decryption process of log information are exemplarily described as follows:
[0120] As shown in Fig. 1, it is a log encryption process of a vehicle T-BOX application program; it involves an application (Application), a log encryption library (Log_encrypt_lib), a first file area (Encrypted Log File), a key tool (Key Tool), a trust area (TrustZone), etc., and under the action of the above parts, its encryption process is as follows: Figure 4b
[0121] 1. To realize vehicle log security, an AES algorithm encryption key needs to be pre-installed in the trust area (TrustZone) in the vehicle T-BOX, specifically, a 16-bit AES key can be written into the trust area (TrustZone) of the T-BOX by the factory using the Key Tool (i.e. key tool) when the T-BOX is shipped.
[0122] 2. The application (Application) calls the interface (i.e. target interface) of the log encryption library (Log_encrypt_lib) to write a log.
[0123] 3. The log encryption library (Log_encrypt_lib) checks whether the key of the trust area (TrustZone) exists. If not, step 4 is performed to read the AES key from the trust area (TrustZone), and if yes, step 4 is not performed.
[0124] 4. The log encryption library (Log_encrypt_lib) reads the AES key from the trust area (TrustZone) and saves it to a process global variable. After saving the key as a global variable, when the application process calls the library interface to write a log again, the key does not need to be read from the trust area (TrustZone) again, which can improve the log encryption efficiency, i.e. each application process reads the key from the trust area (TrustZone) only once in the life cycle.
[0125] 5. The log encryption library (Log_encrypt_lib) uses the AES encryption algorithm to encrypt the log string to obtain binary encrypted ciphertext.
[0126] 6. The Log Encryption Library (Log_encrypt_lib) encodes binary ciphertext using Base64.
[0127] 7. The log encryption library (Log_encrypt_lib) adds newline characters to Base64 characters. Newline characters are used to separate log messages so that decryption can proceed line by line.
[0128] 8. The log encryption library (Log_encrypt_lib) writes Base 64 and newline characters to a file (i.e., the first file).
[0129] During the application process's lifecycle, each log entry is written, and steps 2 through 8 are performed sequentially. The final result stored in the file is a line-by-line string that is AES encrypted and Base64 encoded.
[0130] like Figure 4c The image shows the log decryption process of the vehicle's T-BOX application; it involves the Log Decryption Tool, the first file area (Encrypted Log File), and the second file area (Decrypted Log File), etc. Under the influence of the above parts, the decryption process is as follows:
[0131] 1. The Dectypt Log Tool requires the user to input a decryption key. This decryption tool is not placed in the T-BOX and does not read the TrustZone key from the T-BOX, thus preventing attackers from using it to decrypt logs after infiltrating the T-BOX.
[0132] 2. The Log Decryption Tool reads one line of encrypted log data from the first file area (Encrypted Log File).
[0133] 3. Use the log decryption tool (Dectypt Log Tool) to remove newline characters.
[0134] 4. Use the Dectypt Log Tool to reverse the Base64 encoding to obtain the binary ciphertext.
[0135] 5. The Dectypt Log Tool uses the AES algorithm and a user-input key to decrypt binary ciphertext, obtaining the plaintext log originally written by the application when it called the log encryption library interface.
[0136] 6. The Decrypted Log Tool writes the plaintext into a second file area (Decrypted Log File).
[0137] The decryption steps 2-6 are looped until the end of the encrypted log file, resulting in the entire plaintext log file.
[0138] It should be noted that, for the method embodiment, in order to simply describe, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily the necessary actions of the embodiments of the present application.
[0139] With reference to Figure 5 , a structure schematic diagram of a log management device of a vehicle application provided by an embodiment of the present application is shown, which is applied to a log security system of a vehicle, the log security system comprising a T-BOX of the vehicle, the T-BOX comprising an application, a trust zone, a log encryption library, and a first file area, and specifically can comprise the following modules:
[0140] A target log information acquisition module 501 acquires target log information written through a target interface of the log encryption library when it is detected that the application calls the target interface of the log encryption library;
[0141] A key information acquisition module 502 reads key information from the trust zone through the log encryption library, wherein the key information is written to the trust zone through a key tool;
[0142] An encryption module 503 encrypts the target log information according to the key information through the log encryption library to obtain encrypted log information;
[0143] A first writing module 504 writes the encrypted log information into the first file area through the log encryption library.
[0144] In an embodiment of the present application, the encryption module 503 can comprise:
[0145] An encryption submodule encrypts the target log information according to the key information through the log encryption library to obtain log ciphertext information;
[0146] An encoding submodule encodes the log ciphertext information through the log encryption library to obtain target string information.
[0147] In an embodiment of the present application, the device further comprises:
[0148] a target variable determination module, used by the log encryption library to read a target variable from the log encryption library;
[0149] a judgment module, used by the log encryption library to determine whether the key information exists in the trust zone according to the target variable;
[0150] a first execution module, used by the log encryption library to execute the step of reading the key information from the trust zone when it is determined that the key information does not exist in the trust zone;
[0151] a second execution module, used by the log encryption library to execute the step of performing encryption processing on the target log information according to the key information when it is determined that the key information exists in the trust zone.
[0152] In an embodiment of the present application, the device comprises:
[0153] a global variable module, used by the log encryption library to save the key information as a global variable.
[0154] In an embodiment of the present application, the log security system further comprises a log decryption tool connected with a T-BOX of a vehicle and a second file area, and the device can further comprise:
[0155] an encrypted log information acquisition module, used by the log decryption tool to acquire the encrypted log information from the first file area when it is detected that a target user inputs key information for decrypting an encrypted log in the T-BOX;
[0156] a decryption module, used by the log decryption tool to perform decryption processing on the encrypted log information according to the key information to obtain target log information;
[0157] a second writing module, used by the log decryption tool to write the target log information into a second file area.
[0158] In an embodiment of the present application, the decryption module can comprise:
[0159] a decoding module, used by the log decryption tool to perform Base64 decoding on the encrypted log information to obtain log ciphertext information;
[0160] a decryption module, used by the log decryption tool to perform decryption on the log ciphertext information according to the decryption key to obtain target log information.
[0161] In the embodiment of the present application, when the log encryption library detects that an application program calls a target interface of the log encryption library, the log encryption library acquires target log information written through the target interface, and then reads key information from a trusted area, wherein the key information is written to the trusted area through a key tool, so that the target log information is encrypted according to the key information to obtain encrypted log information, and the encrypted log information is written to a first file area, thereby realizing encryption processing of the log in the application program, effectively preventing the application program plaintext log from being leaked, and preventing an attacker from spying on application program private data through the log.
[0162] An embodiment of the present application further provides a vehicle, which can comprise a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and when the computer program is executed by the processor, the steps of the log management method for the vehicle application are realized.
[0163] An embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the log management method for the vehicle application are realized.
[0164] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts are described in the part of the method embodiment.
[0165] Each embodiment in the present specification is described in a progressive manner, and each embodiment mainly describes differences from other embodiments, and the same parts between the embodiments can be referred to each other.
[0166] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0167] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal devices produce a machine that implements the functions described in the flowcharts and / or block diagrams.Figure 1 one or more processes and / or blocks Figure 1 one or more blocks that can, working together, implement the
[0168] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing Figure 1 one or more processes and / or blocks Figure 1 one or more blocks that can, working together, implement the
[0169] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, so that a series of operational steps are Figure 1 one or more processes and / or blocks Figure 1 one or more blocks that can, working together, implement the
[0170] Although preferred embodiments of the present application have been described, those skilled in the art will be able to make additional modifications and variations to these embodiments without departing from the scope of the present application. Accordingly, it is intended to be included within the scope of the present application that all such modifications and variations are within the scope of the present application. Accordingly, the appended claims are intended to cover all such modifications and variations.
[0171] Finally, it should be noted that, in this document, relational terms such as first and second, and the like can be used solely to distinguish one entity or action from another entity or action without necessarily implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0172] The log management method and log security system of the vehicle application are described in detail above, and the principles and implementation modes of the present application are described by using specific examples. The above description of the examples is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation modes and application ranges can be changed, and the above description should not be understood as a limitation on the present application.
Claims
1. A log management method of a vehicle application program, characterized by, A log security system applied to a vehicle, the log security system comprising a T-BOX of the vehicle, the T-BOX comprising an application program, a trust zone, a log encryption library, and a first file zone, the method comprising: The log encryption library acquires target log information written through a target interface when detecting that the application program calls the target interface of the log encryption library; The log encryption library reads key information from the trust zone, wherein the key information is written to the trust zone through a key tool; The log encryption library encrypts the target log information according to the key information to obtain encrypted log information; The log encryption library writes the encrypted log information to the first file zone; Before the log encryption library reads the key information from the trust zone, the method further comprises: reading a target variable from the log encryption library; determining whether the log encryption library has the key information according to the target variable; when determining that the log encryption library does not have the key information, performing the step of reading the key information from the trust zone; when determining that the log encryption library has the key information, performing the step of encrypting the target log information according to the key information; After the log encryption library reads the key information from the trust zone, the method further comprises: saving the key information as a global variable, so that the application program process reads the key information from the trust zone only once in a life cycle.
2. The method of claim 1, wherein, The log encryption library encrypts the target log information according to the key information to obtain encrypted log information, comprising: encrypting the target log information according to the key information to obtain log ciphertext information; performing Base 64 encoding on the log ciphertext information to obtain encrypted log information.
3. The method of claim 1, wherein, The log security system further comprises a log decryption tool connected with the T-BOX of the vehicle and a second file zone, and the method comprises: The log decryption tool acquires the encrypted log information from the first file zone when detecting that a target user inputs key information for decrypting encrypted logs in the T-BOX; The log decryption tool decrypts the encrypted log information according to the key information to obtain target log information; The log decryption tool writes the target log information to the second file zone.
4. The method of claim 3, wherein, The log decryption tool decrypts the encrypted log information according to the key information to obtain target log information, comprising: performing Base 64 decoding on the encrypted log information to obtain log ciphertext information; decrypting the log ciphertext information according to the decryption key to obtain target log information.
5. A log security system for a vehicle, characterized by The log security system of the vehicle comprises a T-BOX of the vehicle, the T-BOX comprising an application program, a log encryption library, a trust zone, and a first file zone, wherein: the application program is configured to write target log information through a target interface of the log encryption library; The log encryption library is configured to obtain target log information written through the target interface, read key information from the trust zone, encrypt the target log information according to the key information, obtain encrypted log information, and write the encrypted log information into the first file area, wherein the key information is written into the trust zone by a key tool; The trust zone is configured to store the key information; The first file area is configured to store the encrypted target log information; The log encryption library is further configured to read a target variable from the log encryption library, determine whether the log encryption library has the key information according to the target variable, execute the step of reading the key information from the trust zone when it is determined that the log encryption library does not have the key information, and execute the step of encrypting the target log information according to the key information when it is determined that the log encryption library has the key information. The log encryption library is further configured to save the key information as a global variable, so that the application program process reads the key from the trust zone only once in a life cycle.
6. The system of claim 5, wherein, The vehicle security system further comprises a log decryption tool and a second file area, wherein: The log decryption tool is configured to obtain the encrypted log information from the first file area when it is detected that a target user inputs key information for decrypting encrypted logs in the T-BOX, decrypt the encrypted log information according to the key information, obtain target log information, and write the target log information into the second file area; The second file area is configured to save the decrypted target log information.
7. A log management apparatus of a vehicle application program, characterized by comprising: A log security system applied to a vehicle, the log security system comprising a T-BOX of the vehicle, the T-BOX comprising an application program, a trust zone, a log encryption library, and a first file area, and the device comprises: A target log information obtaining module is configured to obtain target log information written through a target interface of the log encryption library when it is detected that the application program calls the target interface of the log encryption library; A key information obtaining module is configured to read key information from the trust zone, wherein the key information is written into the trust zone by a key tool; An encryption module is configured to encrypt the target log information according to the key information, and obtain encrypted log information; A first writing module is configured to write the encrypted log information into the first file area by the log encryption library; A target variable determining module is configured to read a target variable from the log encryption library by the log encryption library; A judging module is configured to determine whether the trust zone has the key information according to the target variable by the log encryption library; A first executing module is configured to execute the step of reading the key information from the trust zone when it is determined that the trust zone does not have the key information by the log encryption library; A second executing module is configured to execute the step of encrypting the target log information according to the key information when it is determined that the trust zone has the key information by the log encryption library. A global variable module for saving the key information as a global variable by the log encryption library so that an application process reads the key only once from a trusted area in a life cycle.
8. A vehicle characterized by comprising: A vehicle application including a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program implementing the log management method of the vehicle application of any one of claims 1 to 4 when executed by the processor.
Citation Information
Patent Citations
Log file encryption method and device, storage medium and electronic equipment
CN112788012A
Data encryption and storage method and device, electronic equipment and storage medium
CN113162763A