Decryption method and device, encryption method and device, electronic equipment and storage medium
By encrypting and decrypting the white-box information generated based on the initial key, the problem of low data security in vehicle OTA two-way authentication communication is solved. The soft password SDK is used to achieve high-security storage and use of data and avoid key leakage. risk.
Patent Information
- Application Number
- CN202410634632.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-06
AI Technical Summary
In vehicle OTA two-way authentication communication scenarios, leakage of data such as private keys can easily cause security risks, and existing encryption methods have low security issues.
Use white box information generated based on the initial key for data encryption and decryption, solve the secure storage and use of target data through software, and use the soft password SDK to achieve symmetric and asymmetric encryption to avoid direct storage of the initial key and improve data security. .
It effectively improves the security of target data and prevents data leakage caused by key leaks. It is suitable for scenarios such as secure OTA and PKI, and achieves high-security storage and use of data.
Smart Images

Figure CN118611909A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to the fields of artificial intelligence, autonomous driving, etc. More specifically, the present disclosure provides a decryption method, an encryption method, a device, an electronic device, a storage medium, a computer program product, and an autonomous driving vehicle. Background Art
[0002] In the vehicle OTA (Over The Air) two-way authentication communication scenario, the vehicle has its own certificate and private key for communicating with the cloud. If the private key and other data are leaked, it is easy to cause security risks. Summary of the invention
[0003] The present disclosure provides a decryption method, an encryption method, an apparatus, an electronic device, a storage medium, a computer program product, and an autonomous driving vehicle.
[0004] According to one aspect of the present disclosure, a decryption method is provided, comprising: in response to receiving a decryption instruction, determining a target file according to the decryption instruction; obtaining white box information from the target file; and decrypting encrypted target data in the target file based on the white box information to obtain decrypted target data; wherein the white box information is generated based on an initial key, and the initial key is not stored in the target file.
[0005] According to another aspect of the present disclosure, an encryption method is provided, including: generating white box information based on an initial key; encrypting target data to be protected based on the white box information to obtain encrypted target data; and writing the white box information and the encrypted target data into a target file.
[0006] According to another aspect of the present disclosure, a decryption device is provided, comprising: a target file determination module, a white box acquisition module and a decryption module. The target file determination module is used to determine the target file in response to receiving a decryption instruction and according to the decryption instruction. The white box acquisition module is used to obtain white box information from the target file, wherein the white box information is generated based on an initial key, and the initial key is not stored in the target file. The decryption module is used to decrypt the encrypted target data in the target file based on the white box information to obtain the decrypted target data.
[0007] According to another aspect of the present disclosure, an encryption device is provided, comprising: a white box generation module, an encryption module, and a writing module. The white box generation module is used to generate white box information based on an initial key. The encryption module is used to encrypt target data to be protected based on the white box information to obtain encrypted target data. The writing module is used to write the white box information and the encrypted target data into a target file.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the decryption method provided by the present disclosure.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the encryption method provided by the present disclosure.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method provided by the present disclosure.
[0011] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided by the present disclosure is implemented.
[0012] According to another aspect of the present disclosure, an autonomous driving vehicle is provided, comprising: the above-mentioned electronic device.
[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0015] Figure 1 is a schematic diagram of an application scenario of an encryption method, a decryption method and a device according to an embodiment of the present disclosure;
[0016] Figure 2 is a schematic flow chart of an encryption method according to an embodiment of the present disclosure;
[0017] Figure 3 is a schematic flow chart of a decryption method according to an embodiment of the present disclosure;
[0018] Figure 4 is a schematic diagram of a soft password SDK according to an embodiment of the present disclosure;
[0019] Figure 5A is a schematic diagram of an initialization process according to an embodiment of the present disclosure;
[0020] Figure 5B is a schematic diagram of a decentralized and white-box encryption process according to an embodiment of the present disclosure;
[0021] Figure 5C is a schematic diagram of a white box decryption and merging process according to an embodiment of the present disclosure;
[0022] Figure 6 is a schematic structural block diagram of an encryption device according to an embodiment of the present disclosure;
[0023] Figure 7 is a schematic structural block diagram of a decryption device according to an embodiment of the present disclosure; and
[0024] Figure 8 It is a structural block diagram of an electronic device used to implement the encryption method and / or decryption method of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0026] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0027] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0028] In some embodiments, the target data to be protected (such as the private key and certificate used for two-way authentication) can be stored in plain text, which is less secure. In other embodiments, the target data to be protected can be written into a file, which is then encrypted and then stored. However, in this way, once the password is leaked, the target data will also be directly leaked, and there is still a problem of low security.
[0029] The disclosed embodiments aim to provide an encryption method and a decryption method, which are based on a soft password SDK and use software to solve the problem of secure storage and use of target data, thereby improving the security of target data.
[0030] The encryption method and decryption method provided by the present disclosure can be applied to secure OTA, PKI (Public Key Infrastructure), and various products that require software-based key protection.
[0031] The technical solution provided by the present disclosure will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Figure 1 It is a schematic diagram of application scenarios of the encryption method, decryption method and device according to an embodiment of the present disclosure.
[0033] It should be noted that Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0034] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a vehicle 110, a network 120, a server 130, etc. The network 120 is used as a medium for providing a communication link between the vehicle 110 and the server 130. The network 120 may include various connection types, such as wired and / or wireless communication links, etc.
[0035] The vehicle 110 may be integrated with sensors such as an on-board camera device, and these sensors may interact with the server 130 via the network 120 to receive or send messages, etc.
[0036] The server 130 may be arranged at a remote end capable of establishing communication with the vehicle-mounted terminal, and may be specifically implemented as a distributed server cluster consisting of multiple servers, or may be implemented as a single server.
[0037] The server 130 may be a server that provides various services, and may have installed thereon, for example, map applications, data processing applications, and the like.
[0038] In the vehicle OTA scenario, the OTA client in the vehicle 110 can use a soft password SDK for two-way authentication. In addition, the soft password SDK supports the selection of a function switch on and off. If the function switch of the soft password SDK is on, the SSL handshake process can be performed through the soft password SDK. If the function switch of the soft password SDK is off, two-way authentication can be performed based on OpenSSL / MbedTLS.
[0039] During the two-way authentication process, the vehicle stores the CA certificate of the server 130 and its own vehicle certificate, and the server 130 stores the CA certificate of the vehicle and its own server certificate. During the handshake process, the server 130 sends its own server certificate to the vehicle 110, and the vehicle 110 uses the server CA to verify whether it is issued by the CA. Similarly, the vehicle 110 will send its own vehicle 110 certificate (a certificate with a public key, not a private key) to the server 130, and the server 130 will use the vehicle CA to verify whether the vehicle certificate is issued by the CA, thereby mutually verifying whether the other party's certificates are valid.
[0040] It should be noted that the decryption method provided in the embodiment of the present disclosure can generally be performed by the vehicle 110 or the server 130. Accordingly, the decryption device provided in the embodiment of the present disclosure can also be set in the vehicle 110 or the server 130. The decryption method provided in the embodiment of the present disclosure can generally be performed by the vehicle 110. Accordingly, the decryption device provided in the embodiment of the present disclosure can also be set in the vehicle 110.
[0041] Understandably, Figure 1 The number of sensors, networks and servers in the embodiment is only for illustration. Any number of sensors, networks and servers may be provided according to the implementation requirements.
[0042] Figure 2 is a schematic flow chart of an encryption method according to an embodiment of the present disclosure.
[0043] like Figure 2 As shown, the encryption method 200 may include operations S210 to S230.
[0044] In operation S210, white-box information is generated based on an initial key.
[0045] In operation S220 , the target data to be protected is encrypted based on the white box information to obtain encrypted target data.
[0046] In operation S230, the white box information and the encrypted target data are written to the target file.
[0047] For example, in a vehicle OTA two-way authentication communication scenario, the target data to be protected may include the private key of the vehicle, and the private key may include a private key in a symmetric key and an asymmetric key. The target data to be protected may also include information such as CSR (Certificate Signing Resquest), device fingerprint, etc. This embodiment does not limit the target data.
[0048] For example, the initial key may be a predetermined character. For another example, the initial key may also be a random character, for example, a randomly generated character of a predetermined length may be used as the initial key, and the predetermined length may be 16 bytes.
[0049] For example, the white box information may include a multidimensional matrix for implementing encryption and decryption of the target data to be protected. If the white box information is used to implement symmetric encryption of data, the same white box information is used for encryption and decryption. If the white box information is used to implement asymmetric encryption of data, encryption and decryption require an encryption white box and a decryption white box respectively. In this case, the decryption white box is written into the target file, and the encryption white box may also be written into the target file for recording.
[0050] For example, the effect of generating white box information based on the initial key may be achieved in a variety of ways, which are not limited in this embodiment.
[0051] For example, a predetermined encryption algorithm may be used, the input of which includes white box information and target data to be protected, and the ciphertext output by the predetermined encryption algorithm is the encrypted target data. This embodiment does not limit the predetermined encryption algorithm.
[0052] For example, the white box information may be written into the file header of the target file, and the encrypted target data may be written into the encrypted portion of the target file.
[0053] It should be noted that the encryption effect achieved by the initial key and the white box information is the same, that is, encrypting the target data based on the initial key (such as AES encryption) can obtain the first ciphertext, and encrypting the target data based on the white box information can obtain the second ciphertext, and the first ciphertext and the second ciphertext are the same. However, encryption using the initial key requires the storage of the initial key, and the exposure of the initial key will cause the target data to be leaked. In this embodiment, the white box information is in the form of a multidimensional matrix, and the white box information will not expose the key used, thereby improving security.
[0054] It is worth noting that if white-box encryption is not used, but other methods other than white-box encryption are used to encrypt the target data, this can also prevent the target data from being directly exposed in the target file. However, encryption using the above other methods still requires the use of other keys. Even if the number of encryption layers is increased, the final key still needs to be stored, so that the target data can still be obtained from the target file by decrypting layer by layer based on the final stored key. Since white-box information is in the form of a multi-dimensional matrix, it can also improve security compared to the above other methods.
[0055] It should be noted that, taking the method of encrypting the target data as symmetric encryption as an example, after using the initial key to generate the white box information, the initial key can be deleted instead of being written into the target file, thereby avoiding directly using the initial key to decrypt the target data, making the white box information unable to play a security protection role.
[0056] In this embodiment, the initial key is used to generate white box information, and then the target data is encrypted using the white box information instead of the initial key. In this way, the initial key is not directly stored, and even if the target file is cracked, the target data cannot be directly obtained from the target file, thereby improving the security of the target data.
[0057] According to another embodiment of the present disclosure, the above-mentioned process of encrypting the target data to be protected based on the white box information to obtain the encrypted target data may include: dividing the target data to be protected into multiple scattered pieces, and then using the white box information to encrypt the multiple scattered pieces respectively, to obtain multiple encrypted scattered pieces as the encrypted target data.
[0058] For example, a predetermined algorithm may be used to disperse the pieces to obtain a plurality of dispersed pieces, and the dispersion method may be average dispersion, dispersion according to a predetermined length, etc., and this embodiment does not limit the division algorithm. The number of dispersed pieces may be a predetermined number, and the predetermined number may be 3.
[0059] For example, the same white box information can be used to encrypt multiple distributed pieces separately.
[0060] This embodiment disperses the target data and then encrypts it through white box information. In this way, after obtaining the target file, the dispersed pieces need to be decrypted first and then merged before the target data can be used. Only decrypting the dispersed pieces cannot use the target data, thereby further improving the security of the target data.
[0061] According to another embodiment of the present disclosure, when the application is started, it can be determined whether the target file exists in the specified path. If it exists, there is no need to create a password file. If it does not exist, the target file can be created. In some embodiments, the process of creating the target file may include: determining reference device fingerprint information.
[0062] For example, the reference device fingerprint information can be input according to actual needs. For another example, the reference device fingerprint information can also be calculated based on the device information of the device, for example, it can be calculated based on the physical machine information and / or virtual machine information of the device, the physical machine information is such as the disk serial number, CPU model, network card name, at least one of Mac, and the virtual machine information includes, for example, the virtual machine uuid, CPU model and number of cores, GPU, network card name and at least one of Mac. The reference device fingerprint information of the device using the target data can be written into the file header of the target file. In this way, during the decryption process, the device fingerprint in the target file can be compared with the actual device fingerprint calculated based on the latest device to see if it is consistent, so as to perform a verification. If the verification passes, the decryption of the target data can continue, otherwise the processing can be stopped. The actual device fingerprint information can be recalculated and verified each time the target file is loaded, so as to prevent the target file from being copied to other devices for use.
[0063] According to another embodiment of the present disclosure, when the application is started, it can be determined whether the target file exists in the specified path. If it exists, there is no need to create a password file. If it does not exist, the target file can be created. In some embodiments, the process of creating the target file can include: generating an encryption file key.
[0064] Exemplarily, a file encryption key can be generated based on an object identifier. For example, the object identifier may include a user PIN code (Personal Identification Number). Different object identifiers generate different file encryption keys, and the same object identifier generates the same file encryption key. There are many ways to generate a file encryption key based on an object identifier, such as converting a PIN code into a summary of an HMAC (Hash-based Message Authentication Code) algorithm, and using the summary as a file encryption key. This embodiment does not limit the method of generating a file encryption key based on an object identifier. In addition, after writing the target data into the target file, the target file can be encrypted using the file encryption key to obtain an encrypted target file. In this embodiment, in addition to encrypting the target data in the target file, the target file is also encrypted twice, which can further improve the security of the target data. In addition, the file encryption key used for encryption is determined based on the user identifier, which can be applied to scenarios where multiple users are isolated. Each user corresponds to a different file encryption key. Different users can decrypt their own target files using their own user identifiers, but cannot decrypt other users' target files. This can achieve identity authentication and prevent other users from decrypting the target file.
[0065] Figure 3is a schematic flow chart of a decryption method according to an embodiment of the present disclosure;.
[0066] like Figure 3 As shown, the decryption method 300 may include operations S310 to S330.
[0067] In operation S310, in response to receiving a decryption instruction, a target file is determined according to the decryption instruction.
[0068] In operation S320, white box information is acquired from the target file.
[0069] In operation S330 , the encrypted target data in the target file is decrypted based on the white box information to obtain the decrypted target data.
[0070] For example, the decryption instruction may include information such as a path, an object identifier, and an identifier keyid of the target data to be decrypted, and the target file may be determined based on the path.
[0071] For example, the white box information is read from a file header of the target file, wherein the white box information is generated based on an initial key, and the initial key is not stored in the target file.
[0072] For example, if a symmetric encryption algorithm is used to encrypt the target file based on white box information, the white box information used for encryption and decryption is the same. If an asymmetric encryption algorithm is used to encrypt the target file based on white box information, the white box information used for encryption and decryption is different. In this case, the white box information used for decryption needs to be read from the target file before decryption.
[0073] In this embodiment, the initial key is not stored in the target file, so even if the target file is cracked, the target data cannot be directly obtained from the target file, thereby improving the security of the target data.
[0074] According to another embodiment of the present disclosure, the decryption instruction includes a path and an object identifier. Accordingly, the process of determining the target file according to the decryption instruction may include: determining whether there is an encrypted target file under the path according to the path in the decryption instruction, and then, when it is determined that the encrypted target file exists, using the object identifier in the decryption instruction to decrypt the encrypted target file to obtain the target file.
[0075] For example, the object identifier may include a user's PIN code, and the object identifier may be used to generate a file decryption key. It should be noted that if a symmetric encryption algorithm is used to encrypt the target file, the file decryption key is the same as the file encryption key; if an asymmetric encryption algorithm is used to encrypt the target file, the file decryption key is different from the file encryption key. Then, a cryptographic operation may be performed on the file decryption key and the encrypted target file, thereby decrypting the target file.
[0076] In this embodiment, in addition to encrypting the target data in the target file, the target file is also encrypted twice, which can further improve the security of the target data. In addition, the file encryption key used for encryption is determined based on the user identification, which can be applicable to the scenario of multi-user isolation. Each user corresponds to a different file encryption key. Different users can decrypt their own target files using their own user identifications, but cannot decrypt other users' target files.
[0077] In some embodiments, if the target file does not exist under the path in the decryption instruction, the above encryption method can be used to generate a new target file under the path.
[0078] According to another embodiment of the present disclosure, the target file also includes reference device fingerprint information. Accordingly, the above process of obtaining white box information from the target file may include: obtaining reference device fingerprint information from the target file, determining actual device fingerprint information based on device information of the device, and then determining whether the reference device fingerprint information and the actual device fingerprint information are consistent. If they are consistent, it means that the verification has passed, and the white box information can be obtained from the target file; if they are inconsistent, it means that the verification has not passed, and the process can be terminated. In this embodiment, the actual device fingerprint information can be recalculated and verified each time the target file is loaded to prevent the target file from being copied to other devices for use.
[0079] According to another embodiment of the present disclosure, the above process of decrypting the encrypted target data in the target file based on the white box information to obtain the decrypted target data may include: based on the target data identifier in the decryption instruction, obtaining multiple encrypted scattered pieces associated with the target data identifier, and then using the white box information to decrypt the multiple encrypted scattered pieces to obtain multiple scattered pieces, and then combining the multiple scattered pieces, for example, combining them according to the order of numbers in the names of the scattered pieces, so as to obtain the target data. In this embodiment, the scattered pieces are first decrypted and then merged, and then the usable target data is obtained. The target data cannot be used by only decrypting the scattered pieces, thereby further improving the security of the target data.
[0080] Figure 4 It is a schematic diagram of a soft password SDK according to an embodiment of the present disclosure.
[0081] In the automotive OTA scenario, the production line can obtain an encrypted password file through the soft password SDK after the first initialization process. Then a CSR with a specified data identifier keyid can be generated, and then a certificate can be applied for through the CSR. After that, the certificate switch can be verified and associated with the specified data identifier keyid, so that the vehicle certificate can be canned on the vehicle side. Target data such as vehicle certificates and private keys are securely stored in the password file of the soft password SDK.
[0082] The following introduces the soft password SDK, taking the private key as the target data to be protected as an example. The soft password SDK provides the security hosting capability of passwords and certificates. By specifying the data identifier keyid, various keys can be used without exposing the key (private key). The SDK ensures the secure storage and use of the key.
[0083] like Figure 4 As shown, the soft password SDK mainly includes two modules: an independent toolbox interface module 401 and a password file association interface module 402 .
[0084] The independent toolbox interface module 401 supports functions such as key generation, cryptographic operations, signature verification, digital certificate correlation, and hash operations. Users manage keys and certificates by themselves to ensure the versatility of the soft cryptographic module SDK.
[0085] The password file association interface module 402 supports secure hosting or generation of user keys and certificates, ensures the security of local storage of private keys, and supports related functions provided in the independent toolbox to ensure the safe use of managed keys. The password file association interface module mainly provides the following functions: SDK initialization and release; secure import and destruction of keys (symmetric, asymmetric); creation of new keys (symmetric, asymmetric); certificate / public key export; key operations (encryption and decryption, signature verification); certificate related (certificate chain settings, CSR generation, certificate application, certificate verification, etc.); two-way authentication; multi-user isolation, anti-copying, security assurance, etc.
[0086] Figure 5A is a schematic diagram of the initialization process according to an embodiment of the present disclosure, Figure 5B is a schematic diagram of a decentralized and white-box encryption process according to an embodiment of the present disclosure, Figure 5C is a schematic diagram of the white-box decryption and merging process according to an embodiment of the present disclosure.
[0087] Please refer to Figure 5A and Figure 5B This embodiment can be applied to the vehicle OTA two-way authentication communication scenario. The vehicle side can host the target book (such as the vehicle's certificate and private key) through the soft password SDK to ensure the safe storage of the target data 541. The soft password SDK is used to host the handshake process of the two-way authentication to ensure the safe use of the target data 541.
[0088] Initialization can be performed when the soft password SDK is started. During the initialization process, instructions can be obtained, which may include information such as object identification, path, identification keyid of the target data 541 to be used, etc. Then, it can be determined whether the target file 551 exists under the path.
[0089] If the target file 551 does not exist under the path in the instruction, it means that this initialization is the first initialization and preprocessing can be performed. Preprocessing may include: generating a file encryption key 510 based on an object identifier (such as a user PIN code). Preprocessing may also include: calculating device fingerprint information based on device information 560 or directly obtaining device fingerprint information as reference device fingerprint information 520. Preprocessing may also include: generating an initial key, such as generating a 16-byte random number as an initial key, and then generating white box information 530 based on the initial key, and discarding the initial key. The reference device fingerprint information 520 and the white box information 530 can then be written into the target file 551.
[0090] For the target data 541 to be protected, there may be multiple target data 541, and each target data 541 may include a key or certificate required for communication between the vehicle and the cloud. The key may include a symmetric key or a private key in an asymmetric key. Each target data 541 corresponds to an identifier keyid, and the target data 541 may be stored in the target file 551 in the form of a key-value pair, and the keyid may be used as the key name, and the content of the target data 541 may be used as the key value.
[0091] Please refer to Figure 5B In order to ensure the security of the target data 541, the same target data 541 in the target file 551 can be stored in blocks. For example, the same target data 541 can be divided into multiple scattered pieces, and then the multiple scattered pieces are encrypted using the white box information 530 to obtain multiple encrypted scattered pieces as encrypted target data 542. The encrypted target data 542 is then written into the target file 551. Since the target data 541 is dispersed and white box encrypted, and the structure of the white box is complex and the key of the white box is random, even if the object identifier is leaked, only the encrypted target file 552 can be decrypted, and the target data 541 in the decrypted target file 551 is also encrypted twice by dispersion and white box encryption. Therefore, even if the object identifier is leaked, it is difficult to directly restore the target data 541 from the decrypted information.
[0092] In addition, the certificate chain path and the latest CSR of each key of each user can be written into the target file 551. These data can be used to determine whether to perform distributed processing and white-box encryption based on actual needs, or they may not be distributed processing and white-box encryption.
[0093] Next, the target file 551, which has been written with the reference device fingerprint information 520, the white box information 530, the encrypted target data 542 and other data, can also be encrypted as a whole. For example, the target file 551 can be encrypted using the file encryption key 510 obtained based on the user identification, thereby obtaining an encrypted target file 552. The encryption algorithm can use symmetric encryption, and the encryption key uses HMAC-MD5 (user PIN code), and the MD5 value of the device fingerprint information is used as the secret. MD5 is a digest algorithm, and the result calculated by it is called the MD5 value. The MD5 value can be a 32-bit hexadecimal string. The encrypted target file 552 can then be stored in the storage space.
[0094] Please refer to Figure 5A and Figure 5C If the target file 551 exists under the path in the instruction, it means that the target file 551 has been generated before. At this time, a series of decryption processes are required to obtain the target data 541.
[0095] For example, the target file 551 can be first decrypted using the file encryption key 510 obtained based on the user identification to obtain the target file 551. Then, the consistency check of the device fingerprint can be performed. For example, the reference device fingerprint information 520 can be read from the target file 551, and the actual device fingerprint information 570 can be calculated based on the device information 560 of the device, and the reference device fingerprint information 520 and the actual device fingerprint information 570 can be compared to see if they are consistent. If they are inconsistent, the initialization fails and the target data 541 cannot be decrypted. If they are consistent, the initialization is successful and the target file 551 can be decrypted.
[0096] Please refer to Figure 5C In the process of decrypting the encrypted target file 552, a number of scattered pieces related to the encrypted target data 542 can be determined according to the data identifier keyid in the instruction. If the data identifier is missing in the instruction, a default identifier can be used. Then, the multiple encrypted scattered pieces are decrypted using the white box information 530, and the decrypted multiple scattered pieces are combined to obtain the target data 541.
[0097] After obtaining the target data 541, if the target data 541 is a key, a cryptographic operation can be performed on the ciphertext obtained by encrypting the plaintext and the key to obtain the plaintext.
[0098] It should be noted that the target file 551 may include multiple target data 541, some of which may be encrypted using symmetric encryption, and the decryption algorithm for these target data 541 may be specified in the instruction when white-box decryption is performed. Other target data 541 may be asymmetric encrypted, and the type of asymmetric encryption may be specified in the instruction when white-box decryption is performed for these target data 541. In addition, each target data 541 may be stored separately in a dispersed and white-box encrypted manner, and the target data 541 to be decrypted is determined by the data identifier keyid during decryption, and other target data 541 does not need to be decrypted. In addition, when updating the target file 551, the new target file 551 may be written first, and then the old target file 551 may be deleted.
[0099] In actual applications, the target data 541 can be managed by the soft password SDK. In order to ensure the security of the private key, the soft password SDK may not provide an export interface for the target data 541. Therefore, the soft password SDK provides functions such as cryptographic operations based on the data identifier keyid and two-way authentication. Users can use it without touching the target data 541.
[0100] Figure 6 It is a schematic structural block diagram of an encryption device according to an embodiment of the present disclosure.
[0101] like Figure 6 As shown, the encryption device 600 may include a white box generation module 610 , an encryption module 620 and a writing module 630 .
[0102] The white box generation module 610 is used to generate white box information based on the initial key.
[0103] The encryption module 620 is used to encrypt the target data to be protected based on the white box information to obtain encrypted target data.
[0104] The writing module 630 is used to write the white box information and the encrypted target data into the target file.
[0105] In this embodiment, the encryption module includes: a division submodule and an encryption submodule. The division submodule is used to divide the target data to be protected into multiple scattered pieces. The encryption submodule is used to use the white box information to encrypt the multiple scattered pieces respectively to obtain multiple encrypted scattered pieces as the encrypted target data.
[0106] In this embodiment, the encryption device further includes: a key generation module and a file encryption module. The key generation module is used to generate a file encryption key based on the object identifier. The file encryption module is used to encrypt the target file using the file encryption key to obtain an encrypted target file.
[0107] In this embodiment, the target file also includes reference device fingerprint information of a device using the target data.
[0108] In this embodiment, the initial key is randomly generated characters of a predetermined length.
[0109] Figure 7 It is a schematic structural block diagram of a decryption device according to an embodiment of the present disclosure.
[0110] like Figure 7 As shown, the decryption device 700 may include a target file determination module 710 , a white box acquisition module 720 and a decryption module 730 .
[0111] The target file determination module 710 is used to determine the target file according to the decryption instruction in response to receiving the decryption instruction.
[0112] The white box acquisition module 720 is used to acquire white box information from the target file, wherein the white box information is generated based on an initial key, and the initial key is not stored in the target file.
[0113] The decryption module 730 is used to decrypt the encrypted target data in the target file based on the white box information to obtain the decrypted target data.
[0114] In this embodiment, the target file also includes reference device fingerprint information. The white box acquisition module includes: a fingerprint acquisition submodule, a fingerprint determination submodule and a first acquisition submodule. The fingerprint acquisition submodule is used to obtain the reference device fingerprint information from the target file. The fingerprint determination submodule is used to determine the actual device fingerprint information based on the device information of the device. The first acquisition submodule is used to obtain the white box information from the target file in response to detecting that the reference device fingerprint information is consistent with the actual device fingerprint information.
[0115] In this embodiment, the decryption module includes: a second acquisition submodule, a first decryption submodule and a combination submodule. The second acquisition submodule is used to acquire multiple encrypted scattered pieces associated with the target data identifier based on the target data identifier in the decryption instruction. The first decryption submodule is used to decrypt the multiple encrypted scattered pieces using the white box information to obtain multiple scattered pieces. The combination submodule is used to combine the multiple scattered pieces to obtain the target data.
[0116] In this embodiment, the target file determination module includes: a file determination submodule and a second decryption submodule. The file determination submodule is used to determine whether there is an encrypted target file under the path according to the path in the decryption instruction. The second decryption submodule is used to decrypt the encrypted target file using the object identifier in the decryption instruction to obtain the target file when it is determined that there is an encrypted target file.
[0117] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned encryption method and / or decryption method.
[0118] According to an embodiment of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the above encryption method and / or decryption method.
[0119] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, including a computer program, which implements the above encryption method and / or decryption method when executed by a processor.
[0120] According to an embodiment of the present disclosure, the present disclosure also provides a vehicle, which may be an autonomous driving vehicle or a non-autonomous driving vehicle, and the vehicle includes electronic equipment.
[0121] Figure 8 It is a block diagram of an electronic device for implementing the encryption method and / or decryption method of an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0122] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0123] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0124] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as encryption methods and / or decryption methods. For example, in some embodiments, the encryption method and / or decryption method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the encryption method and / or decryption method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the encryption method and / or the decryption method in any other appropriate manner (for example, by means of firmware).
[0125] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0126] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0127] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0128] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0129] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0130] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0131] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0132] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A decryption method, comprising: In response to receiving the decryption instruction, determining the target file according to the decryption instruction; Obtaining white box information from the target file; as well as Decrypting the encrypted target data in the target file based on the white box information to obtain the decrypted target data; The white box information is generated based on an initial key, and the initial key is not stored in the target file.
2. The method according to claim 1, wherein: The target file also includes reference device fingerprint information; and obtaining white box information from the target file includes: Acquire the reference device fingerprint information from the target file; Determining actual device fingerprint information based on the device information of the device; and In response to detecting that the reference device fingerprint information is consistent with the actual device fingerprint information, white box information is obtained from the target file.
3. The method according to claim 1, wherein: The decrypting of the encrypted target data in the target file based on the white box information to obtain the decrypted target data includes: Based on the target data identifier in the decryption instruction, obtaining a plurality of encrypted scattered pieces associated with the target data identifier; decrypting the plurality of encrypted scattered pieces using the white box information to obtain a plurality of scattered pieces; and The plurality of dispersed sheets are combined to obtain the target data.
4. The method according to claim 1, wherein: According to the decryption instruction, determining the target file includes: Determining, according to the path in the decryption instruction, whether there is an encrypted target file under the path; and When it is determined that the encrypted target file exists, the encrypted target file is decrypted using the object identifier in the decryption instruction to obtain the target file.
5. An encryption method comprising: generating white box information based on the initial key; Encrypting the target data to be protected based on the white box information to obtain encrypted target data; as well as The white box information and the encrypted target data are written into the target file.
6. The method according to claim 5, wherein: Based on the white box information, the target data to be protected is encrypted, and the encrypted target data obtained includes: Dividing the target data to be protected into a plurality of scattered pieces; and The plurality of scattered pieces are encrypted respectively using the white box information to obtain a plurality of encrypted scattered pieces as the encrypted target data.
7. The method according to claim 5, further comprising: Generate a file encryption key based on the object identifier; as well as The target file is encrypted using the file encryption key to obtain an encrypted target file.
8. The method according to claim 5, wherein: The target file also includes reference device fingerprint information of a device using the target data.
9. The method according to claim 5, wherein: The initial key is randomly generated characters of a predetermined length.
10. A decryption device, comprising: a target file determination module, configured to determine a target file according to the decryption instruction in response to receiving the decryption instruction; A white box acquisition module, used to acquire white box information from the target file; as well as A decryption module, used for decrypting the encrypted target data in the target file based on the white box information to obtain the decrypted target data; The white box information is generated based on an initial key, and the initial key is not stored in the target file.
11. The device according to claim 10, wherein: The target file also includes reference device fingerprint information; The white box acquisition module includes: A fingerprint acquisition submodule, used to acquire the reference device fingerprint information from the target file; A fingerprint determination submodule, used to determine actual device fingerprint information based on device information of the device; and The first acquisition submodule is configured to acquire white box information from the target file in response to detecting that the reference device fingerprint information is consistent with the actual device fingerprint information.
12. The device according to claim 10, wherein: The decryption module comprises: A second acquisition submodule, configured to acquire, based on the target data identifier in the decryption instruction, a plurality of encrypted scattered pieces associated with the target data identifier; A first decryption submodule is configured to decrypt the plurality of encrypted scattered pieces using the white box information to obtain a plurality of scattered pieces; and The combination submodule is used to combine the multiple scattered pieces to obtain the target data.
13. The device according to claim 10, wherein: The target file determination module comprises: A file determination submodule, configured to determine, based on the path in the decryption instruction, whether there is an encrypted target file under the path; and The second decryption submodule is used to decrypt the encrypted target file using the object identifier in the decryption instruction to obtain the target file when it is determined that the encrypted target file exists.
14. An encryption device, comprising: A white box generation module, used for generating white box information based on an initial key; An encryption module, used for encrypting the target data to be protected based on the white box information to obtain encrypted target data; as well as A writing module is used to write the white box information and the encrypted target data into a target file.
15. The device according to claim 14, wherein: The encryption module comprises: a partitioning submodule, configured to partition the target data to be protected into a plurality of dispersed pieces; and The encryption submodule is used to use the white box information to perform encryption processing on the multiple scattered pieces respectively to obtain multiple encrypted scattered pieces as the encrypted target data.
16. The apparatus according to claim 14, further comprising: A key generation module, used for generating a file encryption key based on an object identifier; as well as The file encryption module is used to encrypt the target file using the file encryption key to obtain an encrypted target file.
17. The device according to claim 14, wherein: The target file also includes reference device fingerprint information of a device using the target data.
18. The device according to claim 14, wherein: The initial key is randomly generated characters of a predetermined length.
19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
20. An electronic device, comprising: at least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 5 to 9.
21. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
22. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
23. An autonomous driving vehicle, comprising: The electronic device of claim 19.
Citation Information
Cited By
Data element encryption method and system for satellite communication
CN119210868A
Safety protection method and device for embedded toolkit SDK of two-wheeled vehicle and two-wheeled vehicle
CN122595280A
A method and device for protecting a two-wheeled vehicle embedded toolkit SDK, and a two-wheeled vehicle
CN122595280B
