Method, apparatus and device for generating device fingerprint, and medium
By generating random identification information for the device and adding a timestamp attribute and platform version information for encryption, the problem of easy theft of device fingerprints is solved, and the security and accuracy of device authentication are achieved.
Patent Information
- Application Number
- CN202310799265.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-06-30
AI Technical Summary
Device fingerprints can be easily obtained by unauthorized individuals, making it difficult to guarantee information security.
By generating random identification information for the target device, adding a timestamp attribute, and encrypting it after concatenating it with the platform version information, a device fingerprint is formed, ensuring the security of device authentication.
It improves the security of device fingerprints, prevents tampering and forgery, and ensures the accuracy of identity verification.
Smart Images

Figure CN116723032B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of information security technology, and in particular relates to a method, apparatus, device and medium for generating device fingerprints. Background Technology
[0002] With the rapid development of internet technology, various industries are inevitably facing the threat of fraudulent activities and exploitation by black market operators. For example, application service providers may offer new customer coupons to promote user growth. Without risk control intervention, this can become a breakthrough point for black market operators, who can use various technical means to exploit these coupons and obtain huge amounts of illegal income.
[0003] However, a crucial aspect of risk control is how to identify a device. Typically, application service providers issue device fingerprints to each user device to identify its identity. However, since device fingerprints are exposed, they can easily be obtained by unauthorized individuals and used for illicit activities, making it difficult to guarantee the information security of the service platform. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, device and medium for generating device fingerprints to solve the technical problem that device fingerprints are difficult to guarantee information security in related technologies.
[0005] This application provides a method for generating a device fingerprint, comprising:
[0006] In response to a request to generate a device fingerprint for a target device, first identification information is randomly generated for the target device;
[0007] Add a timestamp attribute to the first identifier information to obtain the second identifier information;
[0008] The platform version information of the target device is concatenated with the second identification information to obtain the third identification information;
[0009] The third identification information is encrypted using the key corresponding to the platform version information to obtain the fourth identification information;
[0010] The fourth identification information and the third identification information are concatenated to obtain the device fingerprint of the target device;
[0011] The device fingerprint is sent to the target device, and the device fingerprint is used to verify the identity of the target device.
[0012] Optionally, adding a timestamp attribute to the first identifier information to obtain the second identifier information includes:
[0013] Calculate the first time difference between the current time point and the reference time point;
[0014] Perform a high-order adjustment operation and a padding operation on the first time difference to obtain the second time difference;
[0015] The second time difference is reversed to obtain the timestamp attribute;
[0016] Add the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information.
[0017] Optionally, before adding the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information, the method further includes:
[0018] The target flag bit is selected by querying the flag bit time sequence table to find the flag bit that matches the current time point. The flag bit time sequence table is a rotation rule for the flag bit as it changes over time.
[0019] Optionally, the step of performing high-order bit adjustment and padding operations on the first time difference to obtain the second time difference includes:
[0020] The annual rings are obtained by taking the modulus of the cycle number of the first time difference;
[0021] When the number of growth rings is greater than 0, the number of digits in the first time difference is padded to the target number of digits using a preset splicing value to obtain the second time difference; or, when the number of growth rings is less than or equal to 0, 0 is added to the first time difference to padded to the target number of digits to obtain the second time difference.
[0022] Add the carry-in number to the highest bit of the second time difference.
[0023] Optionally, the step of reversing the second time difference to obtain the timestamp attribute includes:
[0024] The second time difference is sorted in reverse order to obtain the third time difference;
[0025] The number of bits in the third time difference is randomly obfuscated, and the number of bits in the obfuscated third time difference is padded to a preset number of bits to obtain a fourth time difference of integer type.
[0026] The fourth time difference is converted to the target base, and the converted fourth time difference is padded with length to obtain the fifth time difference;
[0027] The characters in the fifth time difference are swapped with adjacent characters that have not been swapped to obtain the timestamp attribute.
[0028] Optionally, before encrypting the third identification information using the key corresponding to the platform version information to obtain the fourth identification information, the method further includes:
[0029] Calculate the hash operation message authentication code of the platform version information, and use it as the key corresponding to the platform version information.
[0030] Optionally, the method further includes:
[0031] Receive an access request sent by the target device, the access request including at least: the device fingerprint;
[0032] The device fingerprint is parsed to obtain the third identification information and the fourth identification information;
[0033] The fourth identification information is decrypted using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information;
[0034] If the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, the device fingerprint verification is confirmed to be successful.
[0035] This application provides a device fingerprint generation apparatus, comprising:
[0036] The input module is configured to randomly generate first identification information for the target device in response to a device fingerprint generation request for the target device;
[0037] The processing module is used to add a timestamp attribute to the first identification information to obtain the second identification information;
[0038] The platform version information of the target device is concatenated with the second identification information to obtain the third identification information;
[0039] The third identification information is encrypted using the key corresponding to the platform version information to obtain the fourth identification information;
[0040] The output module is used to concatenate the fourth identification information and the third identification information to obtain the device fingerprint of the target device;
[0041] The device fingerprint is sent to the target device, and the device fingerprint is used to verify the identity of the target device.
[0042] Optionally, the processing module is further configured to:
[0043] Calculate the first time difference between the current time point and the reference time point;
[0044] Perform a high-order adjustment operation and a padding operation on the first time difference to obtain the second time difference;
[0045] The second time difference is reversed to obtain the timestamp attribute;
[0046] Add the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information.
[0047] Optionally, the processing module is further configured to:
[0048] The target flag bit is selected by querying the flag bit time sequence table to find the flag bit that matches the current time point. The flag bit time sequence table is a rotation rule for the flag bit as it changes over time.
[0049] Optionally, the processing module is further configured to:
[0050] The annual rings are obtained by taking the modulus of the cycle number of the first time difference;
[0051] When the number of growth rings is greater than 0, the number of digits in the first time difference is padded to the target number of digits using a preset splicing value to obtain the second time difference; or, when the number of growth rings is less than or equal to 0, 0 is added to the first time difference to padded to the target number of digits to obtain the second time difference.
[0052] Add the carry-in number to the highest bit of the second time difference.
[0053] Optionally, the processing module is further configured to:
[0054] The second time difference is sorted in reverse order to obtain the third time difference;
[0055] The number of bits in the third time difference is randomly obfuscated, and the number of bits in the obfuscated third time difference is padded to a preset number of bits to obtain a fourth time difference of integer type.
[0056] The fourth time difference is converted to the target base, and the converted fourth time difference is padded with length to obtain the fifth time difference;
[0057] The characters in the fifth time difference are swapped with adjacent characters that have not been swapped to obtain the timestamp attribute.
[0058] Optionally, the processing module is further configured to:
[0059] Calculate the hash operation message authentication code of the platform version information, and use it as the key corresponding to the platform version information.
[0060] Optionally, the apparatus further includes: a parsing module, used for:
[0061] Receive an access request sent by the target device, the access request including at least: the device fingerprint;
[0062] The device fingerprint is parsed to obtain the third identification information and the fourth identification information;
[0063] The fourth identification information is decrypted using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information;
[0064] If the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, the device fingerprint verification is confirmed to be successful.
[0065] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for generating a device fingerprint.
[0066] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for generating device fingerprints.
[0067] Regarding the relevant technologies, this application has the following advantages:
[0068] This application provides a method, apparatus, device, and medium for generating device fingerprints. By utilizing the platform version information and timestamp attribute of the target device, plaintext identification information is generated for the target device, enabling the device fingerprint to have timeliness and reflect device characteristics. The identification information is then encrypted using the key corresponding to the platform version information. Finally, the plaintext and encrypted identification information are concatenated to form the device fingerprint. This allows the exposed device identification to carry both ciphertext and plaintext identification information. Even if the plaintext information in the device fingerprint is tampered with, the device identity can still be identified by decrypting the ciphertext information in the device fingerprint, avoiding the risk of device fingerprint tampering and forgery, and improving the security of device fingerprints.
[0069] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0070] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0071] Figure 1 This is a flowchart illustrating the steps of a method for generating a device fingerprint according to an embodiment of this application;
[0072] Figure 2 This is one of the flowcharts of another method for generating a device fingerprint provided in this application embodiment;
[0073] Figure 3 This is the second flowchart of another method for generating a device fingerprint provided in this application embodiment;
[0074] Figure 4 This is the third step in a flowchart of another method for generating a device fingerprint provided in this application embodiment;
[0075] Figure 5 This is a logic flowchart of a device fingerprint generation method provided in an embodiment of this application;
[0076] Figure 6 This is a flowchart illustrating the steps of a device fingerprint parsing method provided in an embodiment of this application;
[0077] Figure 7 This is a structural block diagram of a device fingerprint generation apparatus provided in an embodiment of this application;
[0078] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0079] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0080] Figure 1 This is a flowchart illustrating the steps of a device fingerprint generation method provided in an embodiment of this application, including:
[0081] Step 101: In response to the device fingerprint generation request for the target device, first identification information is randomly generated for the target device.
[0082] It should be noted that a target device refers to an electronic device that has the target application installed. The target application can be, for example, a video playback application, a music playback application, a shopping application, etc. For different target devices, the system will generate a unique device fingerprint for the target device that has the target application newly installed or has reinstalled the target application, in order to identify the identity of the target device.
[0083] In this embodiment of the application, after the target device installs the target application, when it first requests access to the server of the target application, the server will first randomly generate first identification information for the target device. The first identification information may be a UUID (Universally Unique Identifier). The UUID is a software construction standard and is also part of the Open Software Foundation in the field of distributed computing environment. Its purpose is to enable all elements in the distributed system to have unique identification information without the need for the central control terminal to specify the identification information. Therefore, each created UUID is different from other UUIDs.
[0084] After generating the first identification information of the target device, the system will remove illegal strings such as "-" and "~" from the first identification information to standardize the character format in the first identification information. The definition of illegal strings can be based on the string usage rules of different systems. That is to say, if the string usage rules of the system define certain strings as illegal characters, or if certain strings are not defined, they can be used as illegal strings. The specific settings can be set according to actual needs, and no restrictions are imposed here.
[0085] Step 102: Add a timestamp attribute to the first identifier information to obtain the second identifier information.
[0086] In this embodiment, to add a time attribute to the generated device fingerprint, thus giving it timeliness and preventing the drawbacks of repeated use, the system breaks down the previously generated first identifier information into character units. Then, it adds a timestamp attribute at a specific position after or before a specific character in the broken-down first identifier information, or at a position adjacent to any character. This timestamp attribute is used to identify the issuance time and validity period of the generated device fingerprint, as well as other time-related information. It is worth noting that the timestamp attribute can be added at a specific position in the first identifier information, such as the 2nd, 10th, or 11th position, allowing the system to directly obtain the timestamp attribute by extracting the string at that specific position during subsequent parsing. Alternatively, it can be a random number of positions, but the system needs to record the added random number of positions to facilitate locating the timestamp attribute during subsequent parsing.
[0087] Furthermore, the second identification information can also include a platform device identifier, which is a unique identifier issued by the application to different devices. Unlike the generated device fingerprint, it does not contain specific information and is only used to identify device usage. Specifically, it can be divided into domestic platform device identifiers, foreign platform device identifiers, and platform device identifiers with some missing dimensions.
[0088] This application embodiment adds the platform device identifier to the device fingerprint, enabling the system to quickly and initially identify which device it is during the parsing process, and then further verify the device identity, thereby improving the efficiency of device identity recognition.
[0089] Step 103: Concatenate the platform version information of the target device with the second identification information to obtain the third identification information.
[0090] In this embodiment, the platform version information may be the device type, device model, application version, version type, platform type of the application installed on the target device, etc. The device type may refer to a computer, mobile phone, tablet computer, etc. The device model may refer to the device manufacturer model. The version type is mainly used to distinguish between virtual machines and the local machine. The platform type refers to browser platform, device platform, mini-program platform, etc. The specific settings can be set according to actual needs and are not limited here.
[0091] Furthermore, by concatenating the platform version information and the second identification information to obtain the third identification information, the generated fingerprint information can reflect the platform version information of the target device. This allows for subsequent verification based on the device fingerprint against the platform version information of the target device, ensuring that the device fingerprint is not used illegally by other devices.
[0092] Step 104: Encrypt the third identification information using the key corresponding to the platform version information to obtain the fourth identification information.
[0093] In this embodiment of the application, the system can pre-store keys corresponding to different platform version information to further encrypt the third identification information to ensure the information security of the generated device fingerprint. Of course, the system can also calculate and create a key corresponding to the platform version information based on the platform version information of the target device when generating the device fingerprint, and then encrypt the third identification information. The system will store the generated key for use when parsing the device fingerprint later.
[0094] Step 105: Concatenate the fourth identification information and the third identification information to obtain the device fingerprint of the target device.
[0095] In this embodiment, the system further concatenates the generated third and fourth identification information to form the device fingerprint of the target device. This allows the device fingerprint to carry both unencrypted third and encrypted fourth identification information. Therefore, even if the device fingerprint is illegally obtained, because the fourth identification information is encrypted, only the plaintext third identification information can be tampered with or forged; the fourth identification information in the device fingerprint cannot be tampered with or forged.
[0096] Step 106: Send the device fingerprint to the target device. The device fingerprint is used to verify the identity of the target device.
[0097] In this embodiment, the system sends a device fingerprint to the target device so that when the target device needs to log in and use the services provided by the application, it can verify its identity by using the device fingerprint carried in the service request sent by the target device. For the server providing the service, it can use its key to reverse-parse the received device fingerprint, comparing the plaintext third identifier information carried in the device fingerprint with the decrypted fourth identifier information to verify the target device's identity. Even if the plaintext third identifier information of the device fingerprint is maliciously tampered with, the target device's identity can still be accurately identified by decrypting the fourth identifier information.
[0098] This application embodiment generates plaintext identification information for the target device by utilizing the platform version information and timestamp attribute of the target device. This allows the device fingerprint to be time-sensitive and reflect the characteristics of the device. The identification information is then encrypted using the key corresponding to the platform version information. Finally, the plaintext and encrypted identification information are concatenated to form the device fingerprint. This allows the exposed device identification to carry both ciphertext and plaintext identification information. Even if the plaintext information in the device fingerprint is tampered with, the device identity can still be identified by decrypting the ciphertext information in the device fingerprint. This avoids the risk of device fingerprint tampering and forgery and improves the security of the device fingerprint.
[0099] Optionally, refer to Figure 2 Step 102 includes:
[0100] Step 1021: Calculate the first time difference between the current time point and the reference time point.
[0101] Step 1022: Perform a high-order adjustment operation and a padding operation on the first time difference to obtain the second time difference.
[0102] Step 1023: Reverse the second time difference value to obtain the timestamp attribute.
[0103] Step 1024: Add the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information.
[0104] In this embodiment, the current time point refers to the time point when the device fingerprint is generated. The reference time point is a fixed time point preset in the system, which is usually earlier than the current time point, such as April 22, 2015, May 21, 2016, etc. The reference time point can be replaced according to a specific time cycle, such as a 10-year cycle, where the reference time point is replaced every 10 years, or it can be 5 years or 20 years, etc. The specific time point can be set according to actual needs, and is not limited here.
[0105] Specifically, the system first calculates the difference between the current time point and the reference time point as the first time difference. Then, it performs high-order bit adjustment and padding operations on the first time difference to ensure that the second time difference has a uniform and standardized number of bits. Afterward, the second time difference is reversed to shuffle its order, thereby improving the security of the obtained timestamp attribute and preventing the true information of the timestamp attribute from being exposed if the second time difference is illegally obtained.
[0106] Optionally, before step 1024, the method further includes: querying a marker bit that matches the current time point in a marker bit timing table as the target marker bit, wherein the marker bit timing table is a rotation rule for marker bits that change with time points.
[0107] In this embodiment, the system can set different marker bits for different times and store the mapping relationship between different time points and marker bits. The target marker bit is the position where a timestamp attribute needs to be added to the first identifier information at the current time point. By setting a marker bit sequence table that rotates the target marker bit, the target marker bit to be added to the timestamp attribute can be obtained by querying each time a timestamp attribute needs to be added. Specifically, the rotation rule in the sequence table can be to cyclically extract the target marker bit from the marker bits in a pre-set order every specific time period, such as every 1 hour, 2 hours, etc. For example, if there are 10 marker bits, the first marker bit is extracted as the target marker bit at the current time point, and the second marker bit is extracted as the target marker bit in the next time period, and so on. When the 10th marker bit is extracted, the first marker bit is used as the target marker bit in the next time period, thereby realizing the replacement of the target marker bit in different time periods.
[0108] This application embodiment determines the target marker bit for adding timestamp attributes by setting different target marker bits for different current time points, avoiding the risk that fixed positions are easily obtained illegally, and improving the information security of the generated device fingerprint.
[0109] Optionally, refer to Figure 3 Step 1022 includes:
[0110] Step 10221: Obtain the annual rings by taking the modulus of the cycle number of the first time difference.
[0111] Step 10222: When the annual rings are greater than 0, use a preset splicing value to fill in the number of digits of the first time difference to the target number of digits to obtain the second time difference; or, when the annual rings are less than or equal to 0, add 0 to the first time difference to fill in the number of digits to the target number of digits to obtain the second time difference.
[0112] Step 10223: Add a carry-in number to the highest bit of the second time difference value.
[0113] In this embodiment of the application, the number of cycles is taken from the first time difference. That is, based on the first time difference, the number of cycles matching the first time difference is taken from the time wheel. The time wheel is set according to the value taking rule set according to the preset time period. The value taking rule sets the calculation method for taking the value at different time points. For example, the time wheel contains a time length of 1 to 365. If the time point is 1, 10000 is added to 1 as the cycle number of 1. If it is 2, 20000 is added to 2 as the cycle number of 2. Of course, this is only an exemplary description. The calculation method and the time length of the time wheel can be set according to actual needs and are not limited here.
[0114] Then, the remainder of the cycle number divided by the time wheel (i.e., modulo operation) is used to obtain the annual rings of the first time difference. The time wheel can have a cycle of 10 years or 20 years. If the annual ring is greater than 0, it means that the remainder of the first time difference is too large. Therefore, preset splicing values such as 1, 2, 3, etc., can be added to the first time difference to fill in the number of digits to the target number of digits. If the annual ring is less than or equal to 0, it means that the remainder of the first time difference is too small. In this case, 0 can be added in front of it to fill in the number of digits of the first time difference to the target number of digits. This ensures that the number of digits of the second time difference is filled in to the target number of digits, thus ensuring the standardization of the second time difference. The target number of digits is related to the specifications of the time wheel. For example, if the time wheel is 10 years in days, then a time wheel exists for 3650 days, and the target number of digits is 4. If the time wheel is 20 years, then the target number of digits is 7300 days, and the target number of digits is also 4. If the time wheel is 30 years, then the target number of digits is 10950 days, and the target number of digits is 5. Of course, this is just an example description, and the target number of digits can be set according to actual needs. There is no limitation here.
[0115] Finally, after adjusting the second time difference to a uniform target number of digits, the carry-over digit of the second time difference is added to the highest digit of the second time difference. The carry-over digit refers to the number carried over to the next digit when the current digit is ten or more in mathematical addition. For example, in a decimal algorithm, if the units digit is ten or more, one is added to the tens digit, resulting in a carry-over of ten. This ensures that the highest digit of the second time difference is not zero, further standardizing the second time difference.
[0116] Optionally, refer to Figure 4 Step 1023 includes:
[0117] Step 10231: Reverse sort the second time difference to obtain the third time difference.
[0118] Step 10232: Randomly obfuscate the number of bits in the third time difference, and pad the number of bits in the obfuscated third time difference to a preset number of bits to obtain a fourth time difference of integer type.
[0119] Step 10233: Convert the fourth time difference to the target base, and pad the converted fourth time difference to obtain the fifth time difference.
[0120] Step 10234: Swap the characters in the fifth time difference with adjacent characters that have not been swapped to obtain the timestamp attribute.
[0121] In this embodiment, after initially reversing the second time difference, the system randomly scrambles the resulting third time difference, disrupting its numerical order. Then, it pads the time difference to a specific number of digits, such as 6 or 7, to ensure the fourth time difference has the correct digit count. The fourth time difference, initially a string, is then converted to an integer. Finally, the length of the fourth time difference is padded, setting a specific character length as a standard. If the length of the fourth time difference is less than this standard, a zero or any digit is added to the beginning of the fourth time difference to bring it to the required length.
[0122] Finally, swap every two characters in the fifth time difference value to obtain the timestamp attribute. The swapping method is to swap adjacent two characters, with each character swapped only once. For example, if there are characters 123456, then 1 and 2 are swapped, 3 and 4 are swapped, and so on.
[0123] This application embodiment improves the information security of the timestamp attribute in the generated device fingerprint by performing reverse ordering, obfuscation, and swapping every two characters on the time difference. This is achieved by reversing the time difference, obfuscating the time difference, and swapping every two characters.
[0124] Optionally, before step 104, the method further includes: calculating a hash message authentication code of the platform version information as a key corresponding to the platform version information.
[0125] In this embodiment, the key used to encrypt platform version information and timestamp attributes can be obtained by the system calculating HMAC (Hash-based Message Authentication Code) for different platform version information when generating device fingerprints, and using the calculated HMAC as the key corresponding to the platform version information. The definition of HMAC uses a cryptographic hash function H and a key K. Assuming H is a hash function capable of cyclically compressing plaintext into blocks, B is the plaintext block length (bytes) of the hash function (in the above hash function, B = 64), and L is the output length (bytes) of the hash function (in MD5, L = 16, and in SHA-1, L = 20). The authentication key K can be of any length, but generally, the key length should be greater than the plaintext block length. The first hash value of the key is used as the actual key for HMAC, and the minimum recommended key length is L bytes.
[0126] This application embodiment uses a hash-based message authentication code as the key for platform version information, thereby ensuring the uniqueness of each key and avoiding the risk of information leakage due to malicious cracking of device fingerprints after using a unified key.
[0127] For ease of understanding, please refer to Figure 5 This application provides a complete process for generating a device fingerprint for a target device in a practical application scenario:
[0128] Assuming the target device is an Android phone and the installed video application is version 15, the Android phone device dimensions can include: imei:A000008A400366, imsi:460016209014582, androidId:85c4166a238b99b1, ip:125.69.211.211, brand:XX, install_time (app installation time):1596507539465; where imei is unique to Android, and each phone has a different imei, and the same applies to imsi, ip is the IP address of the user accessing the app, brand is the phone brand, and install_time is the application installation time.
[0129] Step S1: First, randomly generate a UUID (first identifier):
[0130] d209aa3477074c298b232e389eb2d8ec;
[0131] Step S2: Take this UUID and add the current timestamp to obtain a string. If the timestamp is 1, 3, 0, or 6, then place the timestamp into positions 4, 9, 3, and c of the first identifier information respectively, resulting in:
[0132] d209aa3177074c238b202e389eb2d8e6;
[0133] Step S3: Concatenate the platform version information and the UUID after adding the timestamp into a single string dfpContent (third identifier information):
[0134] 15d209aa3177074c238b202e389eb2d8e6;
[0135] 15 represents the platform version information.
[0136] Step S4: Encrypt the string dfpContent, which is formed by concatenating the key pairs corresponding to the platform version information, to generate an encrypted string (fourth identification information):
[0137] 0a81b12677118785b43131da75593266;
[0138] Step S5: Concatenate the value of dfpContent with the MD5 hash of this encrypted string to generate the device fingerprint ID.
[0139] 15d209aa3177074c238b202e389eb2d8e60a81b12677118785b43131da75593266.
[0140] As can be seen, the device fingerprint generated in the above example contains plaintext information "15d209aa3177074c238b202e389eb2d8e6" that reflects platform version information and timestamp attributes, as well as encrypted platform version information and timestamp "0a81b12677118785b43131da75593266" generated by a specific key. Therefore, by decrypting the encrypted information "0a81b12677118785b43131da75593266" and comparing it with the plaintext information "15d209aa3177074c238b202e389eb2d8e6", the device identity can be easily verified.
[0141] Optionally, refer to Figure 6 After step 105, the method further includes:
[0142] Step 201: Receive an access request sent by the target device, wherein the access request includes at least the device fingerprint.
[0143] In this embodiment of the application, when the target device needs to access the server of the application service, it can send an access request carrying the device fingerprint to the server through a client installed on the target device.
[0144] Step 202: Parse the device fingerprint to obtain the third identification information and the fourth identification information.
[0145] In this embodiment of the application, the server can obtain the plaintext third identification information and the encrypted fourth identification information contained in the device fingerprint by parsing the device fingerprint.
[0146] Step 203: Decrypt the fourth identification information using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information.
[0147] In this embodiment of the application, the server decrypts the fourth identification information using a pre-stored key to obtain the second identification information and platform version information in the fourth identification information, and then extracts the timestamp attribute and the first identification information from the second identification information.
[0148] Step 204: If the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, then the device fingerprint verification is confirmed to be successful.
[0149] In this embodiment of the application, after the device fingerprint is issued to the target device, when the target device accesses the application server again, the system can split the device fingerprint provided by it into third identification information and fourth identification information according to the format; then, it can query the location of the corresponding key and timestamp attribute based on the platform device identifier in the third identification information; after decrypting the fourth identification information using the queried key, it can compare the decrypted fourth identification information with the third identification information to verify the legality of the device fingerprint.
[0150] Specifically, the consistency of the timestamp attribute, platform version information, and first identification information carried in the third identification information is first compared with the consistency of the timestamp attribute, platform version information, and first identification information carried in the fourth identification information. If the two are consistent, it means that the device fingerprint has not been tampered with or forged. If the two are inconsistent, it means that the device fingerprint has been tampered with or forged.
[0151] Furthermore, the generation time of the device fingerprint is obtained based on the timestamp attribute, and then the time interval between the generation time and the current time is calculated. By judging whether the time interval exceeds the time interval threshold for the device fingerprint to be valid, if the time interval is greater than the time interval threshold, it means that the device fingerprint is valid; if the time interval is less than or equal to the time interval threshold, it means that the device fingerprint has expired.
[0152] Furthermore, if the third and fourth identification information match and the timestamp attribute is valid, the device fingerprint verification is deemed successful; if the third and fourth identification information do not match or the timestamp attribute is invalid, the device fingerprint verification is deemed unsuccessful.
[0153] This application embodiment generates plaintext identification information for the target device using the platform version information and timestamp attribute of the target device, enabling the device fingerprint to be timely and reflective of device characteristics. Then, the platform version information and timestamp attribute are encrypted using the key corresponding to the platform version information and concatenated with the plaintext information before encryption to form the device fingerprint. During the device fingerprint parsing process, the plaintext information can be compared with the decrypted ciphertext information to verify the device identity, avoiding the risk of device fingerprint tampering and forgery, and improving the security of device fingerprint.
[0154] Figure 7 This is a structural block diagram of a device fingerprint generation apparatus 30 provided in an embodiment of this application, comprising:
[0155] Input module 301 is used to randomly generate first identification information for the target device in response to a device fingerprint generation request for the target device;
[0156] Processing module 302 is used to add a timestamp attribute to the first identification information to obtain the second identification information;
[0157] The platform version information of the target device is concatenated with the second identification information to obtain the third identification information;
[0158] The third identification information is encrypted using the key corresponding to the platform version information to obtain the fourth identification information;
[0159] Output module 303 is used to concatenate the fourth identification information and the third identification information to obtain the device fingerprint of the target device;
[0160] The device fingerprint is sent to the target device, and the device fingerprint is used to verify the identity of the target device.
[0161] Optionally, the processing module 302 is further configured to:
[0162] Calculate the first time difference between the current time point and the reference time point;
[0163] Perform a high-order adjustment operation and a padding operation on the first time difference to obtain the second time difference;
[0164] The second time difference is reversed to obtain the timestamp attribute;
[0165] Add the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information.
[0166] Optionally, the processing module 302 is further configured to:
[0167] The target flag bit is selected by querying the flag bit time sequence table to find the flag bit that matches the current time point. The flag bit time sequence table is a rotation rule for the flag bit as it changes over time.
[0168] Optionally, the processing module 302 is further configured to:
[0169] The annual rings are obtained by taking the modulus of the cycle number of the first time difference;
[0170] When the number of growth rings is greater than 0, the first time difference is padded to the target number of digits using a preset splicing value to obtain the second time difference; or, when the number of growth rings is less than or equal to 0, 0 is added to the first time difference to padded to the target number of digits to obtain the second time difference.
[0171] Add the carry-in number to the highest bit of the second time difference.
[0172] Optionally, the processing module 302 is further configured to:
[0173] The second time difference is sorted in reverse order to obtain the third time difference;
[0174] The number of bits in the third time difference is randomly obfuscated, and the number of bits in the obfuscated third time difference is padded to a preset number of bits to obtain a fourth time difference of integer type.
[0175] The fourth time difference is converted to the target base, and the converted fourth time difference is padded with length to obtain the fifth time difference;
[0176] The characters in the fifth time difference are swapped with adjacent characters that have not been swapped to obtain the timestamp attribute.
[0177] Optionally, the processing module 302 is further configured to:
[0178] Calculate the hash operation message authentication code of the platform version information, and use it as the key corresponding to the platform version information.
[0179] Optionally, the apparatus further includes: a parsing module, used for:
[0180] Receive an access request sent by the target device, the access request including at least: the device fingerprint;
[0181] The device fingerprint is parsed to obtain the third identification information and the fourth identification information;
[0182] The fourth identification information is decrypted using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information;
[0183] If the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, the device fingerprint verification is confirmed to be successful.
[0184] This application embodiment generates plaintext identification information for the target device by utilizing the platform version information and timestamp attribute of the target device. This allows the device fingerprint to be time-sensitive and reflect the characteristics of the device. The identification information is then encrypted using the key corresponding to the platform version information. Finally, the plaintext and encrypted identification information are concatenated to form the device fingerprint. This allows the exposed device identification to carry both ciphertext and plaintext identification information. Even if the plaintext information in the device fingerprint is tampered with, the device identity can still be identified by decrypting the ciphertext information in the device fingerprint. This avoids the risk of device fingerprint tampering and forgery and improves the security of the device fingerprint.
[0185] The above-described server embodiments are basically similar to the method embodiments, so they are described in a relatively simple manner. For relevant details, please refer to the description of the method embodiments.
[0186] This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0187] Memory 403 is used to store computer programs;
[0188] When the processor 401 executes the program stored in the memory 403, it implements the steps of the above-described method for generating a device fingerprint.
[0189] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0190] The communication interface is used for communication between the aforementioned terminal and other devices.
[0191] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0192] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0193] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the device fingerprint generation method described in any of the above embodiments.
[0194] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the device fingerprint generation method described in any of the above embodiments.
[0195] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0196] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0197] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0198] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for generating a device fingerprint, characterized in that, Applied to servers, including: In response to a request to generate a device fingerprint for a target device, first identification information is randomly generated for the target device; A timestamp attribute is added to the first identification information to obtain the second identification information; the timestamp attribute is added at a specific position in the first identification information. The platform version information of the target device is concatenated with the second identification information to obtain the third identification information; The third identification information is encrypted using the key corresponding to the platform version information to obtain the fourth identification information; the key corresponding to the platform version information is calculated based on the platform version information. The fourth identification information and the third identification information are concatenated to obtain the device fingerprint of the target device; The device fingerprint is sent to the target device, and the device fingerprint is used to verify the identity of the target device; Receive an access request sent by the target device, the access request including at least: the device fingerprint; The device fingerprint is parsed to obtain the third identification information and the fourth identification information; The fourth identification information is decrypted using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information; If the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, the device fingerprint verification is confirmed to be successful.
2. The method according to claim 1, characterized in that, The step of adding a timestamp attribute to the first identifier information to obtain the second identifier information includes: Calculate the first time difference between the current time point and the reference time point; Perform a high-order adjustment operation and a padding operation on the first time difference to obtain the second time difference; The second time difference is reversed to obtain the timestamp attribute; Add the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information.
3. The method according to claim 2, characterized in that, Before adding the timestamp attribute to the target marker bit in the first identification information to obtain the second identification information, the method further includes: The target flag bit is selected by querying the flag bit time sequence table to find the flag bit that matches the current time point. The flag bit time sequence table is a rotation rule for the flag bit as it changes over time.
4. The method according to claim 2, characterized in that, The step of performing high-order adjustment and padding operations on the first time difference to obtain the second time difference includes: The annual rings are obtained by taking the modulus of the cycle number of the first time difference; When the number of growth rings is greater than 0, the number of digits in the first time difference is padded to the target number of digits using a preset splicing value to obtain the second time difference; or, when the number of growth rings is less than or equal to 0, 0 is added to the first time difference to padded to the target number of digits to obtain the second time difference. Add the carry-in number to the highest bit of the second time difference.
5. The method according to claim 2, characterized in that, The step of reversing the second time difference to obtain the timestamp attribute includes: The second time difference is sorted in reverse order to obtain the third time difference; The number of bits in the third time difference is randomly obfuscated, and the number of bits in the obfuscated third time difference is padded to a preset number of bits to obtain a fourth time difference of integer type. The fourth time difference is converted to the target base, and the converted fourth time difference is padded with length to obtain the fifth time difference; The characters in the fifth time difference are swapped with adjacent characters that have not been swapped to obtain the timestamp attribute.
6. The method according to claim 1, characterized in that, Before encrypting the third identification information using the key corresponding to the platform version information to obtain the fourth identification information, the method further includes: Calculate the hash operation message authentication code of the platform version information, and use it as the key corresponding to the platform version information.
7. A device fingerprint generation apparatus, characterized in that, Applied to servers, including: The input module is configured to randomly generate first identification information for the target device in response to a device fingerprint generation request for the target device; The processing module is used to add a timestamp attribute to the first identification information to obtain the second identification information; the timestamp attribute is added at a specific number of bits in the first identification information. The platform version information of the target device is concatenated with the second identification information to obtain the third identification information; The third identification information is encrypted using the key corresponding to the platform version information to obtain the fourth identification information; The output module is used to concatenate the fourth identification information and the third identification information to obtain the device fingerprint of the target device; The device fingerprint is sent to the target device, and the device fingerprint is used to verify the identity of the target device; wherein, the server providing the functional service verifies the identity of the target device by comparing the third identification information in the device fingerprint with the decrypted fourth identification information; The parsing module is used to receive an access request sent by the target device, the access request including at least: the device fingerprint; parse the device fingerprint to obtain the third identification information and the fourth identification information; decrypt the fourth identification information using the key to obtain the timestamp attribute, platform version information, and first identification information carried in the fourth identification information; if the timestamp attribute, platform version information, and first identification information carried in the third identification information are consistent with the timestamp attribute, platform version information, and first identification information carried in the fourth identification information, and the time interval between the timestamp attribute and the current time point does not exceed the time interval threshold, the device fingerprint verification is confirmed to be successful.
8. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the device fingerprint generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the device fingerprint generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
System and method for security authentication of mobile devices
CN106529963A
Information processing method and device, communication equipment and storage medium
CN112492580A
Equipment fingerprint processing method, user side, server, system and storage medium
CN113709513A
