Data distribution method, apparatus, device, and storage medium
By generating public and private key information of the channel provider to encrypt the APP installation package, and using a secure hash algorithm and web crawler program for verification, the problem of channel providers stealing the APP installation package is solved, and the secure distribution and source identification of the installation package are achieved.
Patent Information
- Application Number
- CN202110052841.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-15
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2041-01-15
AI Technical Summary
In existing technologies, the data distribution of APP installation packages lacks security, and theft among channel providers is common, making it impossible to guarantee the security of the installation packages.
By generating the public and private key information of the target channel provider, the installation package is encrypted using an asymmetric encryption algorithm and carries a channel information tag to ensure that the installation package can only be decrypted by the target channel provider. The integrity of the installation package is verified by using a secure hash algorithm and a web crawler.
This improves the security of app installation package distribution, prevents theft among distributors, and ensures the traceability and integrity of the installation package's origin.
Smart Images

Figure CN114764503B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more particularly to a data distribution method, apparatus, device, and storage medium. Background Technology
[0002] With the widespread use of smartphones, people are increasingly reliant on mobile applications (Apps) for communication, social interaction, and entertainment. To promote their apps, internet companies distribute them to various distribution channels, such as Tencent App Store and Wandoujia, who then encourage users to install the apps. However, different distribution channels charge different fees.
[0003] Currently, internet companies directly distribute app installation packages containing channel information to the corresponding channel partners. Different channel partners receive app installation packages that only differ in the channel information. Users install the app through these channel partners. However, some channel partners, driven by profit, steal app installation packages from other channel partners, resulting in a lack of security in the distribution of app installation package data. Summary of the Invention
[0004] This application provides a data distribution method, apparatus, device, and storage medium. By generating first public key information, first private key information, and an encrypted first installation package based on the application request information of the target channel provider, and sending the first installation package marked by the first channel information to the target channel provider, the security of installation package distribution is improved.
[0005] In a first aspect, embodiments of this application provide a data distribution method, the method comprising: receiving an application acquisition request from a target channel provider; determining, based on the application acquisition request from the target channel provider, whether to send an application installation package to the target channel provider; after determining to send the application installation package to the target channel provider, generating first public key information and first private key information based on the application acquisition request, and using the first public key information as first channel information of the target channel provider; generating a first installation package based on the first private key information, wherein the first private key information is used for encryption of the first installation package, the first installation package carries the first channel information, and the first channel information is used to mark the first installation package; and sending the first installation package and the first public key information to the target channel provider, wherein the first public key information is used for decryption of the first installation package.
[0006] In one optional implementation, the application acquisition request includes the name information of the target channel provider, the application information of the application, and the IP information of the server. After determining to send the application installation package to the target channel provider, generating first public key information and first private key information according to the application acquisition request, and using the first public key information as the first channel information of the target channel provider, includes: after determining to send the application installation package to the target channel provider, converting the name information, the application information, the IP information, and the time information of receiving the application acquisition request into the first public key information, using the first public key information as the first channel information of the target channel provider; and generating the first private key information corresponding to the first public key information.
[0007] In one optional implementation, the application information includes the application name and the application version number;
[0008] The first public key information is obtained through SHA calculation and satisfies the formula Publickey = sha128Hash(name + appname + appversion + Timestamp + IP information), where Publickey is the first public key information, sha128Hash is a 128-bit hash algorithm in SHA, name is the name information of the target channel provider, appname is the application name, appversion is the version number, and Timestamp is the time information; the first private key information satisfies the formula PrivateKey = RSA.Create(Publickey), where RSA.Create is an RSA algorithm, and PrivateKey is the first private key information.
[0009] In an optional implementation, determining whether to send the application installation package to the target channel provider based on the application acquisition request includes: if the IP information exists in a preset IP list, determining to send the application installation package to the target channel provider, wherein the preset IP list includes server IP addresses assigned to the target channel provider; if the IP information does not exist in the preset IP list, determining not to send the application installation package to the target channel provider.
[0010] In an optional implementation, the first channel information carried by the first installation package is encrypted with first key information; a first module of the first installation package contains the first channel information; and a second module of the first installation package contains the first key information; the first module and the second module are paired modules; the first key information satisfies the formula key = Ay3 +By 2 The +Cy+D requirement is that the key is the first secret key information, the y is the first channel information, the A is the module number of the first module, the B is the module number of the second module, and the C and the D are obtained by concatenating the A and the B. The C is AB and the D is BA.
[0011] In an optional implementation, generating a first installation package based on the first private key information, wherein the first private key information is used for encrypting the first installation package, and the first installation package carries the first channel information, wherein the first channel information is used to mark the first installation package, includes: converting the original installation package into a first hash value using a secure hash algorithm, wherein the original installation package is an unencrypted installation package; inserting the first channel information and the first private key information into the first hash value to obtain a second hash value; and encrypting the second hash value using the first private key information to obtain the first installation package.
[0012] In an optional implementation, after sending the first installation package and the first public key information to the target channel provider, the method further includes: receiving receipt information from the target user installing the application, the receipt information containing second channel information carried by the second installation package used by the target user to install the application, and second public key information used by the target user to install and decrypt the second installation package; verifying whether the second installation package sent by the target channel provider to the target user is the first installation package by comparing the first public key information, the second public key information, and the second channel information; obtaining a third installation package provided by the target channel provider to the user through a web crawler; and verifying the third installation package based on the third channel information carried by the third installation package.
[0013] Secondly, embodiments of this application provide a data distribution apparatus, the method comprising: a receiving unit for receiving an application acquisition request from a target channel provider; a judging unit for judging whether to send an application installation package to the target channel provider based on the application acquisition request; a first generating unit for generating first public key information and first private key information based on the application acquisition request after determining to send the application installation package to the target channel provider, and using the first public key information as first channel information of the target channel provider; a second generating unit for generating a first installation package based on the first private key information, wherein the first private key information is used for encrypting the first installation package, the first installation package carries the first channel information, and the first channel information is used to mark the first installation package; and a sending unit for sending the first installation package and the first public key information to the target channel provider, wherein the first public key information is used for decrypting the first installation package.
[0014] In one optional implementation, the application acquisition request includes the name information of the target channel provider, the application information of the application, and the IP information of the server. The first generation unit is specifically used to, after determining to send the installation package of the application to the target channel provider, convert the name information, the application information, the IP information, and the time information of receiving the application acquisition request into the first public key information, and use the first public key information as the first channel information of the target channel provider; and generate the first private key information corresponding to the first public key information.
[0015] In one optional implementation, the application information includes the application name and the application version number; the first public key information is obtained by SHA calculation, and the first public key information satisfies the formula Publickey = sha128Hash(name + appname + appversion + Timestamp + IP information), where Publickey is the first public key information, sha128Hash is a 128-bit hash algorithm in SHA, name is the name information of the target channel provider, appname is the application name, appversion is the version number, and Timestamp is the time information; the first private key information satisfies the formula PrivateKey = RSA.Create(Publickey), where RSA.Create is an RSA algorithm, and PrivateKey is the first private key information.
[0016] In an optional implementation, the determining unit is specifically configured to, if the IP information exists in a preset IP list, determine to send the application installation package to the target channel provider, wherein the preset IP list includes server IP addresses assigned to the target channel provider; and if the IP information does not exist in the preset IP list, determine not to send the application installation package to the target channel provider.
[0017] In an optional implementation, the first channel information carried by the first installation package is encrypted with first key information; a first module of the first installation package contains the first channel information; and a second module of the first installation package contains the first key information; the first module and the second module are paired modules; the first key information satisfies the formula key = Ay 3 +By 2The +Cy+D requirement is that the key is the first secret key information, the y is the first channel information, the A is the module number of the first module, the B is the module number of the second module, and the C and the D are obtained by concatenating the A and the B. The C is AB and the D is BA.
[0018] In one optional implementation, the second generation unit is specifically used to convert the original installation package into a first hash value using a secure hash algorithm, wherein the original installation package is an unencrypted installation package of the application; insert the first channel information and the first key information into the first hash value to obtain a second hash value; and encrypt the second hash value using the first private key information to obtain the first installation package.
[0019] In an optional implementation, the receiving unit is further configured to receive receipt information from the target user installing the application. The receipt information includes second channel information carried by the second installation package used by the target user to install the application, and second public key information used by the target user to decrypt the second installation package. The data distribution device further includes a verification unit, configured to verify whether the second installation package sent by the target channel provider to the target user is the first installation package by comparing the first public key information, the second public key information, and the second channel information. The data distribution device further includes an acquisition unit, configured to acquire a third installation package provided by the target channel provider to the user through a web crawler. The verification unit is further configured to verify the third installation package based on the third channel information carried by the third installation package.
[0020] Thirdly, embodiments of this application provide an apparatus including a receiver and a transmitter, further comprising: a processor adapted to implement one or more instructions; and a computer storage medium storing one or more instructions adapted to be loaded by the processor and executed as described in the first aspect above and in the optional implementations of the first aspect above.
[0021] Fourthly, embodiments of this application provide a storage medium storing one or more instructions, which are adapted to be loaded by a processor and executed as described in the first aspect and the optional implementations of the first aspect.
[0022] This application provides a data distribution method, apparatus, device, and storage medium. By generating a first public key information, a first private key information, and an encrypted first installation package based on the application request information of the target channel provider, and sending the first installation package to the target channel provider, the security of the installation package distribution is improved. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0024] Figure 1 A flowchart illustrating a data distribution method provided in an embodiment of this application;
[0025] Figure 2 A flowchart illustrating another data distribution method provided in this application embodiment;
[0026] Figure 3 This is a schematic diagram of the structure of a data distribution device provided in an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0028] The terms "first," "second," and "third," etc., in the specification, embodiments, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0029] This application provides a data distribution method. To more clearly describe the solution of this application, some knowledge related to data distribution will be introduced below.
[0030] Asymmetric encryption algorithms are a method of key confidentiality. They require two keys: a public key and a private key. These are a pair; if data is encrypted with the public key, it can only be decrypted with the corresponding private key. Because encryption and decryption use two different keys, this type of algorithm is called asymmetric encryption. The basic process of exchanging confidential information using asymmetric encryption is as follows: Party A generates a key pair and publishes the public key. Party B, who needs to send information to Party A, uses Party A's public key to encrypt the confidential information before sending it to Party A; Party A then decrypts the encrypted information using its own private key. Conversely, when Party A wants to reply to Party B, it encrypts the data using Party B's public key, and Party B decrypts it using its own private key. Furthermore, Party A can sign confidential information with its private key before sending it to Party B; Party B then verifies the signature using Party A's public key.
[0031] The RSA algorithm was proposed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. It is the most widely studied public-key algorithm, possessing the cryptographic property that makes it impossible to derive the private key from the public key. Since its inception, the RSA algorithm has withstood various attacks and has gradually gained acceptance, widely considered one of the best public-key schemes available.
[0032] A secure hash algorithm (SHA) is a family of cryptographic hash functions certified by the Federal Information Processing Standards (FIPS). SHA is an algorithm that calculates a fixed-length string corresponding to a digital message. Designed by the U.S. National Security Agency and published by the National Institute of Standards and Technology (NIST), SHA is a U.S. government standard.
[0033] Elliptic curve cryptography (ECC) is an algorithm for establishing public-key cryptography, also known as asymmetric encryption. ECC is widely recognized as the most secure encryption algorithm for a given key length.
[0034] The data distribution method provided in the embodiments of this application will now be described in detail.
[0035] Figure 1 This is a flowchart illustrating a data distribution method provided in an embodiment of this application. Figure 1 As shown, the method may include:
[0036] 101. Receive application acquisition requests from target channel partners.
[0037] Specifically, the data distribution device receives application acquisition requests from target channel partners. These requests are used by the target channel partners to request the app installation package from the data distribution device.
[0038] The application acquisition request includes the target channel provider's name, the application information requested by the target channel provider, and the Internet Protocol (IP) information of the server hosting the requested application. The application information includes the requested application name, or a combination of the application name and version number. For example, the application acquisition request might include the application name "Alipay," the application version number "10.2.10," the server IP address "01100100.00000100.00000101.00000110," and the target channel provider's name "App Store." It should be noted that the IP information includes at least one IP address; it can be a single IP address or a list of IP addresses.
[0039] It should be noted that the data distribution device in step 101 can generate a first installation package based on the application acquisition request of the target channel provider and send the first installation package to the target channel provider, thus avoiding the problem of installation package theft caused by sending the original installation package to the target channel provider.
[0040] 102. Based on the target channel provider's application acquisition request, determine whether to send the application installation package to the target channel provider.
[0041] Specifically, the data distribution device determines whether to send the application installation package to the target channel provider based on the application acquisition request. In some embodiments, if the data distribution device has IP information in a preset IP list, it determines to send the application installation package to the target channel provider. The preset IP list consists of server IP addresses assigned by the data distribution device to the target channel provider for downloading the installation package. If the IP information does not exist in the preset IP list, it is determined that the target channel provider is using another channel provider's download channel, and the data distribution server determines not to send the first installation package to the target channel provider. Optionally, if the IP information does not exist in the preset IP list, the data distribution device determines not to send the application installation package to the target channel provider and stops performing the operations of generating the first public key information, the first private key information, and the first installation package, as well as sending the first installation package and the first public key information to the target channel provider.
[0042] It should be noted that through step 102, the data distribution device can determine whether to send the application installation package to the target channel provider based on the application acquisition request. This enables the identification of whether the target channel provider is stealing the download channels of other channel providers based on the application request. In the event that the target channel provider is stealing the download channels of other channel providers, the device will stop sending the installation package to the target channel provider, thereby improving the efficiency of installation package distribution.
[0043] 103. After determining to send the application installation package to the target channel provider, generate the first public key information and the first private key information according to the application acquisition request, and use the first public key information as the first channel information of the target channel provider.
[0044] Specifically, after determining to send the application installation package to the target channel provider, the data distribution device generates first public key information and first private key information based on the target channel provider's application acquisition request. The first public key information is used as the target channel provider's first channel information. The first private key information is used by the data distribution device to encrypt the original application installation package; this is also referred to as signing the original application installation package. After the original installation package is encrypted using the first private key information, the first installation package is obtained. The first public key information is used by the target channel provider's terminal or the target user's terminal to decrypt the first installation package; this is also referred to as verifying the signature on the first installation package using the target channel provider's terminal or the target user's terminal. The first channel information is used to distinguish the source of the application installation package.
[0045] In one optional implementation, when the application acquisition request includes the name information of the target channel provider, the application information requested by the target channel provider, and the IP information of the server to which the application belongs, the data distribution device, after determining to send the application installation package to the target channel provider, converts the name information, application information, IP information, and the time information of receiving the application acquisition request into first public key information, and uses the first public key information as the first channel information of the target channel provider. In another optional implementation, when the application acquisition request includes the name information of the target channel provider, the application information requested by the target channel provider, and the IP information of the server to which the application belongs, the data distribution device converts the name information, application information, IP information, and the time information of the data distribution device determining the generation of the first public key information into the first public key information.
[0046] In some embodiments, the data distribution device combines name information, application name, application version number, IP information, and time information, and converts them into first public key information using the SHA algorithm. For example, the first public key information satisfies the formula Publickey = sha128Hash(name + appname + appversion + Timestamp + IP information), where Publickey is the first public key information, and sha128Hash refers to the SHA 128-bit hash algorithm. According to the above formula, the first public key information is a 128-bit string. It should be noted that the data distribution device can also use other algorithms to convert name information, application information, IP information, and time information into first public key information. The first public key information can be a 128-bit string or a string of other lengths; no limitation is made here.
[0047] After the data distribution device generates the first public key information, it generates the corresponding first private key information. Optionally, the data distribution device generates the first private key information using an asymmetric encryption algorithm. The first private key information satisfies the following formula:
[0048] PrivateKey = RSA.Create(Publickey), where the first public key information is "Publickey", the first private key information is "PrivateKey", and RSA.Create is an RSA algorithm.
[0049] It should be noted that the embodiments of this application do not limit the type of asymmetric encryption algorithm. It can be the RSA algorithm or other asymmetric encryption algorithms, and can be adjusted according to the specific circumstances.
[0050] It should be noted that, through step 103, the data distribution device can generate first public key information and first private key information based on the application acquisition request of the target channel provider. The first public key information and first private key information are used to verify and encrypt the original installation package of the application, thereby achieving the technical effect of improving the security of the application installation package.
[0051] 104. Based on the first private key information, generate the first installation package. The first private key information is used to encrypt the first installation package. The first installation package carries the first channel information, which is used to mark the first installation package.
[0052] Specifically, the data distribution device generates a first installation package based on the first private key information. The first private key information is used to encrypt the first installation package. The first installation package carries first channel information, which is used to mark the first installation package.
[0053] In one optional implementation, the data distribution device generates a first installation package based on the first private key information. Specifically, the data distribution device converts the original installation package into a first hash value using a secure hash algorithm; the original installation package is an unencrypted application installation package. The data distribution device then inserts the first channel information and the first private key information into the first hash value to obtain a second hash value. Finally, the data distribution device encrypts the second hash value using the first private key information to obtain the first installation package. In this implementation, the data distribution device improves the confidentiality of the first installation package by using a secure hash algorithm and the first private key information.
[0054] Understandably, since the first installation package is encrypted using the first private key information, it is decrypted using the first public key information. If the data distribution device uses different public key information to generate different private key information to encrypt the original installation package, the data distribution device can generate at least two distinct installation packages. Because the encrypted installation packages generated by the data distribution device are different from each other, target channel partners cannot easily copy or modify installation packages obtained by other channel partners, thus preventing channel partners from stealing data and improving the security of application installation package data distribution.
[0055] The data distribution device inserts the first channel information and the first key information into the first installation package, further differentiating the application installation package, increasing the difficulty for channel providers to steal the installation package, and improving the security of data distribution using the application installation package.
[0056] Optionally, the data distribution device can insert the first channel information or the first key information into the code segment of the module by defining a first string array in the first constructor of the first module. This first string array is used to store the first channel information or the first key information. For example, the first string array can be in the form of Char text
[129] = ['a','b','c',.......], where Char[] represents the string array, "text" is the name of the string array, and 129 indicates that the string array has 129 characters, used to store 128 characters of the first channel information. The first constructor can be inserted at the beginning of the first function. Compared to the form of text
[129] = ['abc…'] which stores the string in the data segment, this implementation method can hide the first public key information in the code segment of the installation package, increasing the difficulty of obtaining and modifying the first channel information, thereby increasing the difficulty of stealing the installation package and improving the security of the installation package distribution.
[0057] It should be noted that each application's installation package includes at least one module. The first installation includes the first module.
[0058] Optionally, the data distribution device defines a first string group in the first destructor of the first module. This first destructor and the first constructor are located at the beginning and end of the first function, respectively. By matching the first string group in the first destructor and the first string group in the first constructor, the same strings in the first constructor and the first destructor are used as the first channel information or the first key information. For example, if the first constructor contains the string "Char text
[129] " and the first destructor also contains the string "Char text
[129] ", then the string "Char text
[129] " is the first string we insert. This avoids using string groups other than the first string group in the first function as the first channel information or the first key information.
[0059] The first function is obtained through a function selection algorithm, which determines whether a function in the first installation package should be selected as the first function. Optionally, the function selection algorithm is as follows: First, calculate the Fa value of function i using Fa(i) = size(i) / {size(1) + size(2) + size(3) + ... + size(n)}, where size(i) is the function size of function i, and {size(1) + size(2) + size(3) + ... + size(n)} is the sum of the function sizes of all functions in the first installation package; then, generate a random number m between 0 and 1. If m is less than or equal to Fa(i), function i is selected as the first function; if m is greater than Fa(i), function i is not selected as the first function. This method selects the first function based on its size, with larger functions being more likely to be selected as the first function. This hides the first channel information or the first key information in the first function, increasing the difficulty of obtaining and modifying the first public key information and improving the security of the installation package distribution.
[0060] In one optional implementation, the encrypted first channel information and first key information are stored in the first module and the second module of the first installation package, respectively. This implementation increases the difficulty of obtaining the first channel information and the first key information from the first installation package, further improving the security of the installation package distribution. Optionally, the module number of the second module is paired with the module number of the first module, and the module number of the first module and the module number of the second module are a pair of numbers determined by the first channel information. In some embodiments, the module number of the first module is N, the first channel information is p-ary data, n is the number obtained by taking N modulo p, n = N % p, and n is included in the first channel information. For example, if the string group of the first channel information is Publickey[], then in the first channel information, there exists Publickey[k] == n, where k represents the character position number that is the same as n in the first channel information; the module number M of the second module is the number obtained by taking k modulo the total number of modules s, M = k % s.
[0061] The first module has at least one location where the first public key information can be stored. This location can be a first function or a gap between function codes. The data distribution device encodes multiple locations to obtain the coordinates of the location where the first channel information can be stored. The location where the first channel information is stored in the first module changes non-linearly. In one optional implementation, the location of the first public key information in the first module is determined by the first channel information and the total number of installation packages generated by the data distribution device. For example, the location information of the first channel information is ax. 3 +bx 2 The formula is: +cx+d, where coefficients a, b, c, and d are four data points extracted from the first channel information, and x is the total number of installation packages generated by the data distribution device. The data distribution device extracts at least one two-digit number from the least significant bit of the location information as the location coordinates of the first channel information. For example, assuming the location information is 72912, extracting two digits from the least significant bit yields 12, 29, and 7, which are the location coordinates of the first public key information within the first module. It is understandable that storing at least one piece of first channel information in the first module increases the difficulty of obtaining and modifying the first channel information, and differentiates the generated installation packages, increasing the difficulty of stealing the installation packages and thus improving the security of installation package distribution. Furthermore, multiple pieces of first channel information within the first installation package facilitate the data distribution device's verification of whether the installation package has been modified, improving the accuracy of the verification.
[0062] In one optional implementation, the first key information is calculated using an elliptic curve algorithm. The coefficients of the elliptic curve algorithm are determined by the module numbers of the first and second modules and the first public key information. The first key information satisfies the formula key = Ay. 3 +By 2 The +Cy+D requirement states that A and B are the module numbers of the first and second modules, respectively, and C and D are obtained by concatenating A and B, where C = AB and D = BA. y represents the first channel information. In this implementation, the first channel information is stored in different modules, resulting in different first key information. This increases the difficulty for channel providers to decrypt the first channel information from the first installation package, thereby improving the security of the installation package distribution.
[0063] It should be noted that through step 104, the data distribution device can obtain the encrypted first installation package by using the first private key information, and differentiate the first installation package by using the first channel information and the first secret key information, thereby increasing the difficulty of the installation package being stolen and achieving the technical effect of improving the security of the application installation package.
[0064] 105. Send the first installation package and the first public key information to the target channel provider. The first public key information is used to decrypt the first installation package.
[0065] Specifically, the data distribution device sends a first installation package and a first public key to the target channel provider. The first public key is used to decrypt the first installation package.
[0066] It is understandable that, in addition to the first public key information carried in the first installation package, the data distribution device will also send the first public key information to the target channel provider. The first public key information is used to perform asymmetric decryption on the first installation package.
[0067] In this process, the first installation package is encrypted using the first private key information and decrypted using the first public key information. If the data distribution device uses different public key information to generate different private key information to encrypt the original installation package, the data distribution device can generate at least two distinct installation packages. The first installation package can only be decrypted using the first public key information, and the source of the installation package can be identified through the decrypted first public key information, facilitating verification of the application installation package's origin. Since the encrypted installation packages generated by the data distribution device are distinct, target channel providers cannot easily copy or modify installation packages obtained by other channel providers, preventing channel providers from stealing data and improving the security of application installation package data distribution.
[0068] It should be noted that, through step 105, the data distribution device can send the first public key information and the first installation package to the target channel provider. The first public key information is used to verify the signature and decrypt the first installation package, which facilitates the identification of the source of the first installation package and helps to detect whether the first installation package has been stolen or modified, thus achieving the technical effect of improving the security of the application installation package.
[0069] This application provides a data distribution method, apparatus, device, and storage medium. By generating first public key information, first private key information, and an encrypted first installation package based on the application request information of the target channel provider, and sending the first installation package carrying the first channel information to the target channel provider, the security of the installation package distribution is improved.
[0070] Figure 2 This is a flowchart illustrating a data distribution method provided in an embodiment of this application. The method is... Figure 2 Further refinement and detail of the method shown may include:
[0071] 201. Receive application acquisition requests from target channel partners.
[0072] Specifically, the data distribution device receives application acquisition requests from target channel partners. These requests are used by the target channel partners to request the app installation package from the data distribution device.
[0073] The application acquisition request includes the target channel provider's name, the application information requested by the target channel provider, and the Internet Protocol (IP) information of the server hosting the requested application. The application information includes the requested application name, or a combination of the application name and version number. For example, the application acquisition request might include the application name "Alipay," the application version number "10.2.10," the server IP address "01100100.00000100.00000101.00000110," and the target channel provider's name "App Store." It should be noted that the IP information includes at least one IP address; it can be a single IP address or a list of IP addresses.
[0074] It should be noted that through step 201, the data distribution device can achieve the technical effect of generating a first installation package based on the application acquisition request of the target channel provider and sending the first installation package to the target channel provider, thus avoiding the problem of installation package theft caused by sending the original installation package to the target channel provider.
[0075] 202. Based on the application acquisition request from the target channel provider, determine whether to send the application installation package to the target channel provider.
[0076] Specifically, the data distribution device determines whether to send the application installation package to the target channel provider based on the target channel provider's application acquisition request.
[0077] It should be noted that through step 102, the data distribution device can determine whether to send the application installation package to the target channel provider based on the application acquisition request. This enables the identification of whether the target channel provider is stealing the download channels of other channel providers based on the application request. In the event that the target channel provider is stealing the download channels of other channel providers, the device will stop sending the installation package to the target channel provider, thereby improving the efficiency of installation package distribution.
[0078] 203. After determining to send the application installation package to the target channel provider, generate the first public key information and the first private key information according to the application acquisition request, and use the first public key information as the first channel information of the target channel provider.
[0079] Specifically, after determining to send the application installation package to the target channel provider, the data distribution device generates first public key information and first private key information based on the application acquisition request, and uses the first public key information as the first channel information of the target channel provider.
[0080] It should be noted that, through step 203, the data distribution device can generate first public key information and first private key information based on the application acquisition request of the target channel provider. The first public key information and first private key information are used to verify and encrypt the original installation package of the application, thereby achieving the technical effect of improving the security of the application installation package.
[0081] 204. Based on the first private key information, generate the first installation package. The first private key information is used for the encryption of the first installation package.
[0082] Specifically, the data distribution device generates a first installation package based on the first private key information, and the first private key information is used to encrypt the first installation package.
[0083] It should be noted that through step 204, the data distribution device can obtain the encrypted first installation package by using the first private key information, and differentiate the first installation package by using the first channel information and the first key information, thereby increasing the difficulty of the installation package being stolen and achieving the technical effect of improving the security of the application installation package.
[0084] 205. Send the first installation package and the first public key information to the target channel provider. The first public key information is used to decrypt the first installation package.
[0085] Specifically, the data distribution device sends a first installation package and a first public key to the target channel provider. The first public key is used to decrypt the first installation package.
[0086] Steps 201-205 are similar to steps 101-105 in Embodiment 1 of this application, and will not be described again here.
[0087] It should be noted that through step 205, the data distribution device can send the first public key information and the first installation package to the target channel provider. The first public key information is used to verify the signature and decrypt the first installation package, which facilitates the identification of the source of the first installation package and helps to detect whether the first installation package has been stolen or modified, thus achieving the technical effect of improving the security of the application installation package.
[0088] 206. Receive receipt information from the target user for installing the application. The receipt information includes the second channel information carried by the second installation package used by the target user to install the application, and the second public key information used by the target user to install the second installation package.
[0089] Specifically, the data distribution device receives receipt information from the target user's application installation. This receipt information includes second channel information carried in the second installation package used by the target user to install the application, and second public key information used by the target user to install the second installation package. The second channel information includes application information of the installation package used by the target user to install the application, the name information of the channel provider, and the IP information of the server.
[0090] The second public key information is the public key information sent by the target channel provider to the target user, which is used to decrypt the target user's device and install the second installation package.
[0091] It should be noted that through step 205, the data distribution device can verify the installation package used by the target user to install the application based on the receipt information, thus achieving the technical effect of identifying the installation package used by the target user based on the basic receipt information.
[0092] 207. By comparing the first public key information, the second channel information, and the second public key information, verify whether the second installation package sent by the target channel provider to the target user is the first installation package.
[0093] Specifically, the data distribution device compares the second public key information with the second channel information to determine if the second installation package has been modified. If the second public key information and the second channel information are the same, it determines that the second installation package has not been modified and is the installation package provided by the data distribution device. If the second public key information and the second channel information are different, the data distribution device determines that the second installation package has been modified, the target channel provider has altered the application installation package, and the second installation package is not the first installation package. If the second public key information and the second channel information are the same, the data distribution device compares the first public key information with the second public key information. If the first public key information and the second public key information are the same, it determines that the target user has installed the first installation package, and there is no installation package theft. If the first public key information and the second public key information are different, it indicates that the target channel provider has stolen another installation package.
[0094] It should be noted that through step 207, the data distribution device can identify whether the target channel provider has installed the prescribed first installation package and detect whether the target channel provider has stolen or modified the application installation package, thus achieving the technical effect of improving the data distribution and installation performance of the application installation package.
[0095] 208. Obtain the third-party installation package provided to users by the target channel provider through a web crawler.
[0096] Specifically, the data distribution device uses a web crawler to obtain a third installation package provided by the target channel provider to the user. This third installation package is the application installation package provided by the target channel provider on a server or terminal for the target user. After receiving the first installation package, the target channel provider sends the second installation package to the terminal of the target user who requested to download the application.
[0097] A web crawler, generally referring to a web crawler, is a program or script that automatically retrieves information from the World Wide Web according to certain rules. Data distribution devices can use web crawlers to systematically obtain secondary installation packages provided by distribution providers.
[0098] It should be noted that through step 208, the data distribution device can obtain the third-party installation package provided by the target channel provider to the target user through the crawler program. This is beneficial for identifying whether the target channel provider has modified the installation package through the third-party installation package, thereby achieving the technical effect of improving the data distribution and installation of application installation packages.
[0099] 209. Verify the third installation package based on the third channel information carried by the third installation package.
[0100] Specifically, the data distribution device verifies the third installation package based on the third channel information carried in the third installation package. Specifically, the data distribution device verifies whether the third installation package has been modified by obtaining the third channel information carried in the third installation package. In one optional implementation, the data distribution device obtains all the third channel information carried in the third installation package, determines whether all the third channel information is the same, and compares the third channel information with the recorded first channel information. If all the third channel information is the same, and it is also the same as the first channel information, it is determined that the third installation package has not been modified, and it becomes the first installation package sent by the data distribution device.
[0101] It should be noted that through step 208, the data distribution device can verify the third installation package provided by the target channel provider and check whether the second installation package is the first installation package generated by the data distribution device. This is to detect whether the target channel provider has altered or stolen the application installation package, thereby further improving the technical effectiveness of application installation package data distribution and installation.
[0102] This application provides a data distribution method, apparatus, device, and storage medium. By generating first public key information, first private key information, and an encrypted first installation package based on the application request information of the target channel provider, and sending the first installation package marked with the first channel information to the target channel provider, the security of the installation package distribution is improved.
[0103] Figure 3 This is a schematic diagram of the structure of a signal device provided in an embodiment of this application. Figure 3 The data distribution device in the above corresponds to the receiver mentioned above. For example... Figure 3 As shown, the data distribution device includes:
[0104] Receiving unit 301 receives the application acquisition request from the target channel merchant;
[0105] The judgment unit 302 determines whether to send the application installation package to the target channel merchant based on the application acquisition request from the target channel merchant.
[0106] After determining that the installation package of the application will be sent to the target channel provider, the first generation unit 303 generates first public key information and first private key information according to the application acquisition request, and uses the first public key information as the first channel information of the target channel provider.
[0107] The receiving unit 304 is further configured to generate a first installation package based on the first private key information, wherein the first private key information is used for encrypting the first installation package, the first installation package carries the first channel information, and the first channel information is used to mark the first installation package;
[0108] The sending unit 305 sends the first installation package and the first public key information to the target channel provider, wherein the first public key information is used for decrypting the first installation package.
[0109] In one optional implementation, the application acquisition request includes the target channel provider's name information, the application's application information, and the server's Internet Protocol (IP) information. The first generation unit 302 is specifically used to, after determining to send the application's installation package to the target channel provider, convert the name information, the application information, the IP information, and the time information of receiving the application acquisition request into the first public key information, and use the first public key information as the target channel provider's first channel information; and generate the first private key information corresponding to the first public key information.
[0110] In one optional implementation, the application information includes the application name and the application version number; the first public key information is calculated using the secure hash algorithm SHA, satisfying the formula Publickey = sha128Hash(name + appname + appversion + Timestamp + IP information), where Publickey is the first public key information, sha128Hash is a 128-bit hash algorithm in SHA, name is the name of the target channel provider, appname is the application name, appversion is the version number, and Timestamp is the time information; the first private key information satisfies the formula PrivateKey = RSA.Create(Publickey), where RSA.Create is an RSA algorithm, and PrivateKey is the first private key information.
[0111] In an optional implementation, the determining unit is specifically configured to, if the IP information exists in a preset IP list, determine to send the application installation package to the target channel provider, wherein the preset IP list includes server IP addresses assigned to the target channel provider; and if the IP information does not exist in the preset IP list, determine not to send the application installation package to the target channel provider.
[0112] In an optional implementation, the first channel information carried by the first installation package is encrypted with first key information; a first module of the first installation package contains the first channel information; a second module of the first installation package contains the first key information; the first module and the second module are paired modules; the first key information satisfies the formula key = Ay 3 +By 2 The requirements for +Cy+D are: key is the first key information, y is the first channel information, A is the module number of the first module, B is the module number of the second module, and C and D are obtained by concatenating A and B. C is AB and D is BA.
[0113] In one optional implementation, the second generation unit 303 is specifically used to convert the original installation package into a first hash value using a secure hash algorithm, wherein the original installation package is an unencrypted installation package of the application; insert the first channel information and the first key information into the first hash value to obtain a second hash value; and encrypt the second hash value using the first private key information to obtain the first installation package.
[0114] In an optional implementation, the receiving unit 301 is further configured to receive receipt information from the target user installing the application. The receipt information includes second channel information carried by the second installation package used by the target user to install the application, and second public key information used by the target user to install and decrypt the second installation package. The data distribution device further includes a verification unit 306, configured to verify whether the second installation package sent by the target channel provider to the target user is the first installation package by comparing the first public key information, the second public key information, and the second channel information. The data distribution device further includes an acquisition unit 307, configured to acquire a third installation package provided by the target channel provider to the user through a crawler program. The verification unit 306 is further configured to verify the third installation package based on the third channel information carried by the third installation package.
[0115] It should be understood that the division of the various modules in the above data distribution device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. For example, each module can be a separate processing element, or it can be integrated into the same chip. Alternatively, it can be stored as program code in the controller's storage element, and called and executed by a processing element of the processor. Furthermore, the modules can be integrated together or implemented independently. The processing element here can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method or each module can be completed through the integrated logic circuit in the hardware of the processor element or through software instructions. This processing element can be a general-purpose processor, such as a central processing unit (CPU), or one or more integrated circuits configured to implement the above method, such as one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc.
[0116] The following describes a device provided in an embodiment of this application. Please refer to [link / reference]. Figure 4 As shown, the device includes:
[0117] Receiver 401, transmitter 402, processor 403, and memory 404 (where the number of processors 403 in the device 400 can be one or more, Figure 4 (Taking a processor as an example). In some embodiments of this application, the receiver 401, transmitter 402, processor 403, and memory 404 can be connected via a bus or other means, wherein... Figure 4 Taking the example of a connection between China and Israel via a bus.
[0118] Memory 404 may include read-only memory and random access memory, and provides instructions and data to processor 403. A portion of memory 404 may also include non-volatile random access memory (NVRAM). Memory 404 stores operating systems and operating instructions, executable modules or data structures, or subsets thereof, or extended sets thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic business functions and handling hardware-based tasks.
[0119] Processor 403 controls the operation of electronic devices. Processor 403 can also be called a central processing unit (CPU). In specific applications, the various components of electronic devices are coupled together through a bus system. This bus system includes not only data buses but also power buses, control buses, and status signal buses. However, for clarity, all buses in the diagram are referred to as a bus system.
[0120] The methods disclosed in the embodiments of this application can be applied to processor 403, or implemented by processor 403. Processor 403 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 403 or by instructions in the form of software. The processor 403 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 404. Processor 403 reads the information in memory 404 and, in conjunction with its hardware, completes the steps of the above method.
[0121] The receiver 401 can be used to receive input digital or character information, and generate signal inputs related to the settings and function control of the electronic device. The transmitter 402 may include a display device such as a display screen, and the transmitter 402 can be used to output digital or character information through an external interface.
[0122] In this embodiment of the application, processor 403 is used to execute the data distribution method executed by the aforementioned data distribution device.
[0123] In embodiments of this application, a computer-readable storage medium is provided, which stores a computer program. When executed by a processor, the computer program performs the following: receiving an application acquisition request from a target channel provider; generating first public key information and first private key information based on the application acquisition request from the target channel provider; generating a first installation package based on the first private key information, wherein the first private key information is used for encryption of the first installation package; and sending the first installation package to the target channel provider, wherein the first installation package carries the first public key information, wherein the first public key information is used for verification of the first installation package.
[0124] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data distribution method, characterized in that, include: Receive application acquisition requests from target channel partners; Based on the application acquisition request from the target channel provider, determine whether to send the application installation package to the target channel provider; After determining to send the application installation package to the target channel provider, first public key information and first private key information are generated according to the application acquisition request, and the first public key information is used as the first channel information of the target channel provider; Based on the first private key information, a first installation package is generated. The first private key information is used to encrypt the first installation package. The first installation package carries the first channel information. The first channel information is used to mark the first installation package. Send the first installation package and the first public key information to the target channel provider, wherein the first public key information is used for decrypting the first installation package; The application acquisition request includes the name information of the target channel provider, the application information of the application, and the Internet Protocol (IP) information of the server. After determining to send the application installation package to the target channel provider, the step of generating first public key information and first private key information based on the application acquisition request, and using the first public key information as the first channel information of the target channel provider, includes: After determining to send the application installation package to the target channel provider, the name information, application information, IP information and the time information of receiving the application acquisition request are converted into the first public key information, and the first public key information is used as the first channel information of the target channel provider. Generate the first private key information corresponding to the first public key information.
2. The method according to claim 1, characterized in that, The application information includes the application name and the application version number; The first public key information is calculated using the secure hash algorithm SHA. The first public key information satisfies the requirement of the formula Publickey=sha128Hash(name + appname + appversion + Timestamp + IP information). The Publickey is the first public key information, the sha128Hash is a 128-bit hash algorithm in SHA, the name is the name information of the target channel provider, the appname is the application name, the appversion is the version number, and the Timestamp is the time information. The first private key information satisfies the requirement of the formula PrivateKey = RSA.Create(Publickey), where RSA.Create is an RSA algorithm and PrivateKey is the first private key information.
3. The method according to claim 1, characterized in that, The step of determining whether to send the application installation package to the target channel provider based on the application acquisition request includes: If the IP information exists in the preset IP list, it is determined to send the application installation package to the target channel provider. The preset IP list includes server IP addresses assigned to the target channel provider. If the IP information is not found in the preset IP list, it is determined not to send the application installation package to the target channel provider.
4. The method according to claim 1, characterized in that, The first channel information carried in the first installation package is encrypted with the first key information. The first module of the first installation package contains the first channel information, and the second module of the first installation package contains the first key information. The first module and the second module are two paired modules. The first key information satisfies the formula key = Ay 3 + By 2 The requirements for +Cy +D are as follows: the key is the first secret key information, the y is the first channel information, the A is the module number of the first module, the B is the module number of the second module, and the C and the D are obtained by concatenating the A and the B. The C is AB and the D is BA.
5. The method according to claim 4, characterized in that, The first installation package is generated based on the first private key information. The first private key information is used to encrypt the first installation package. The first installation package carries the first channel information, which is used to identify the first installation package, including: The original installation package is converted into a first hash value using a secure hash algorithm. The original installation package is the application's unencrypted installation package. Insert the first channel information and the first key information into the first hash value to obtain the second hash value; The first private key information is used to encrypt the second hash value to obtain the first installation package.
6. The method according to any one of claims 1-5, characterized in that, After sending the first installation package and the first public key information to the target channel provider, the method further includes: Receive receipt information from the target user for installing the application. The receipt information includes second channel information carried by the second installation package used by the target user to install the application, and second public key information used by the target user to install and decrypt the second installation package. By comparing the first public key information, the second public key information, and the second channel information, it is verified whether the second installation package sent by the target channel provider to the target user is the first installation package. The third installation package provided to the user by the target channel provider is obtained through a web crawler program; The third installation package is verified based on the third channel information carried by the third installation package.
7. A device comprising a receiver and a transmitter, characterized in that, Also includes: A processor, adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions adapted to be loaded by the processor and executed as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores one or more instructions, which are adapted to be loaded by a processor and executed as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Traffic attracting method and system based on user consumption sharing
CN106204112A
Signature method of application installation package, related device, storage medium and electronic equipment
CN110414190A
Installation package generation method and device
CN111198692A