Digital encryption transmission method and device, equipment and storage medium
By mapping the target data to custom encoding on the server side and generating special font files, the problem in the existing technology of data being stolen by crawlers using OCR technology is solved, and the safe display and readability of data are achieved.
Patent Information
- Application Number
- CN202411561656.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, e-commerce systems achieve data confusion through picture technology, but if the data in the picture is clear and neat, it is easy to be identified and crawled by crawler programs using OCR technology.
On the server side, the target data is mapped to a custom encoding and a special font file is generated for displaying the target data. The client uses the font file to display the custom encoding as the target data, thus preventing crawlers from using OCR technology to steal data.
Display target data through font files, avoiding the problem of stealing data by using OCR technology to steal data, ensuring the readability and security of the target data.
Smart Images

Figure CN119363463A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a digital encryption transmission method, device, equipment and storage medium. Background Art
[0002] In order to ensure the normal operation of the server or to ensure that the information in the server is not stolen by crawlers, some companies use various means to prevent crawlers from indiscriminately requesting resources from the server and stealing information in the server. This behavior is called anti-crawler.
[0003] At present, e-commerce systems usually use image technology to achieve data obfuscation, that is, convert the data to be obfuscated into images, and use images to replace numbers to display to users. The principle of this method is: on the server side, according to the data to be obfuscated, generate an image containing the data and save it to the server. On the front end, request and display the image through image tags or other methods instead of directly displaying the data. However, based on this method, if the data in the image is relatively clear and neat, the data will be recognized and crawled by the crawler program using OCR (Optical Character Recognition). Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a digital encryption transmission method, device, equipment and storage medium, which can map the target data to a custom code on the server side, generate a special font file for displaying the target data, and the client uses the font file to display the custom code as the target data when displaying the data, thereby avoiding the problem of crawlers using OCR technology to steal the target data when using pictures to display the target data. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a digital encryption transmission method, which is applied to a browser, comprising:
[0006] Sending a data acquisition request containing the browser fingerprint summary corresponding to the browser end to the server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to the preset cloud platform with the browser fingerprint summary as the file name;
[0007] Obtaining a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom code rule; the target data is data corresponding to the data acquisition request determined by the server;
[0008] The target font file is obtained from the preset cloud platform based on the browser fingerprint summary, and the target font file is used to display the target custom code corresponding to the target data in the response message.
[0009] Optionally, before sending the data acquisition request including the browser fingerprint summary corresponding to the browser to the server, the method further includes:
[0010] Using JavaScript to obtain feature information of the browser, and generating the browser fingerprint summary corresponding to the browser based on the feature information corresponding to the browser and a preset canvas element;
[0011] The browser fingerprint summary corresponding to the browser side is embedded into the data acquisition request using the axios library.
[0012] Optionally, before sending the data acquisition request including the browser fingerprint summary corresponding to the browser to the server, the method further includes:
[0013] JavaScript and the browser fingerprint summary are used to create a font file address determination rule, and the address of the target font file in the preset cloud platform is specified by the font file address determination rule.
[0014] Optionally, the using the target font file to display the target custom code corresponding to the target data in the response message includes:
[0015] Determine whether there is a target obfuscation field tag in the response message, and if there is the target obfuscation field tag in the response message, parse the target obfuscation field tag to determine the data to be obfuscated in the target data according to the field name corresponding to the field list in the target obfuscation field tag;
[0016] The class name of the target custom encoding corresponding to the data to be obfuscated is set as a target obfuscation class name, and the target custom encoding corresponding to the data to be obfuscated in the target data is displayed according to the target obfuscation class name and the target font file; wherein the target obfuscation class name is used to match the target custom encoding corresponding to the data to be obfuscated with the target font file.
[0017] In a second aspect, the present application discloses a digital encryption transmission method, which is applied to a server, comprising:
[0018] Receiving a data acquisition request from a browser end including a browser fingerprint summary corresponding to the browser end;
[0019] Generate a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and upload the target font file to a preset cloud platform with the browser fingerprint summary as the file name;
[0020] Map the target data to the corresponding target custom code according to the preset custom code rule;
[0021] The target custom code is embedded in a response message and sent to the browser end so that the browser end receives the response message, obtains the target font file from the preset cloud platform according to the browser fingerprint summary, and uses the target font file to display the target custom code corresponding to the target data in the response message.
[0022] Optionally, generating a target font file corresponding to the browser fingerprint digest according to the browser fingerprint digest includes:
[0023] Obtaining the browser fingerprint summary from the data acquisition request, and verifying whether the browser fingerprint summary is legal;
[0024] If the browser fingerprint summary is legal, the mapping relationship corresponding to the browser fingerprint summary is obtained locally;
[0025] If the mapping relationship does not exist, randomly map the code in the blank coding area of the Unicode with the data to be obfuscated in the target data, store the corresponding mapping relationship locally, and associate the mapping relationship with the browser fingerprint summary;
[0026] Extracting a preset glyph object corresponding to the data to be obfuscated from an existing initial font file on the browser side, defining a font file generation function, utilizing the font file generation function, and generating the target font file based on the preset glyph object and the mapping relationship, and setting the file name of the target font file to the browser fingerprint summary.
[0027] Optionally, mapping the target data to a corresponding target custom code according to a preset custom code rule includes:
[0028] Marking the data interface containing the target data by presetting the obfuscation field mark to obtain a marked data interface, and analyzing the return type corresponding to the marked data interface;
[0029] Obtain a list of fields corresponding to the data to be obfuscated contained in the return type corresponding to the marked data interface;
[0030] Obtaining the browser fingerprint summary from the data acquisition request, and verifying whether the browser fingerprint summary is legal;
[0031] If the browser fingerprint summary is legal, then obtaining the mapping relationship corresponding to the browser fingerprint summary from the local computer according to the browser fingerprint summary;
[0032] If the mapping relationship exists, the data to be obfuscated in the target data is mapped to the corresponding target custom code according to the mapping relationship and the field list.
[0033] Optionally, before the target custom code is embedded in the response message and sent to the browser, the method further includes:
[0034] After identifying the field list contained in the return type corresponding to the marked data interface, adding the field names of the field list to the target obfuscation field tags;
[0035] The target obfuscated field tag including the field name and the target custom code are added to the response message to send the response message to the browser.
[0036] In a third aspect, the present application provides a digital encryption transmission device, which is applied to a browser, comprising:
[0037] A request sending module, used to send a data acquisition request containing a browser fingerprint summary corresponding to the browser end to a server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to a preset cloud platform with the browser fingerprint summary as the file name;
[0038] A message acquisition module, used to acquire a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom code rule; the target data is the data corresponding to the data acquisition request determined by the server;
[0039] A data display module is used to obtain the target font file from the preset cloud platform based on the browser fingerprint summary, and use the target font file to display the target custom code corresponding to the target data in the response message.
[0040] In a fourth aspect, the present application provides an electronic device, including:
[0041] Memory, used to store computer programs;
[0042] The processor is used to execute the computer program to implement the aforementioned digital encryption transmission method.
[0043] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned digital encryption transmission method when executed by a processor.
[0044] In this application, a data acquisition request containing a browser fingerprint summary corresponding to the browser is first sent to the server, so that the server generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to the preset cloud platform with the browser fingerprint summary as the file name, and then obtains the response message corresponding to the data acquisition request sent by the server; wherein the response message contains the target custom code obtained by the server after converting the target data based on the preset custom code rule; the target data is the data corresponding to the data acquisition request determined by the server, and finally obtains the target font file from the preset cloud platform based on the browser fingerprint summary, and uses the target font file to display the target custom code corresponding to the target data in the response message. It can be seen that when the client displays the target data, the target data is displayed by using the font file generated by the server, rather than displaying the target data in the form of a picture, thereby avoiding the problem of crawlers using OCR technology to steal the target data in the picture; by using font files instead of obfuscated pictures to display data, the readability of the target data is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0046] Figure 1 A flow chart of a digital encryption transmission method disclosed in this application;
[0047] Figure 2 A flow chart of a digital encryption transmission method disclosed in this application;
[0048] Figure 3 This is a schematic diagram of the structure of a digital encryption transmission device disclosed in this application;
[0049] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] At present, the anti-crawler method in the e-commerce system is to achieve data obfuscation through image technology, that is, converting the data to be obfuscated into images, and using images instead of numbers to display to users. However, based on this method, if the data in the image is relatively clear and neat, the data will be recognized and crawled by the crawler program using OCR technology. To this end, the present application provides a digital encryption transmission method, which solves the problem of crawlers stealing data using OCR technology by using font files to display target data.
[0052] See also Figure 1 As shown, the embodiment of the present invention discloses a digital encryption transmission method, which is applied to a browser side, including:
[0053] Step S11, sending a data acquisition request containing the browser fingerprint summary corresponding to the browser end to the server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to the preset cloud platform with the browser fingerprint summary as the file name.
[0054] In this embodiment, before sending the data acquisition request containing the browser fingerprint summary to the server, it also includes: using JavaScript to obtain the feature information of the browser, and based on the corresponding feature information of the browser and the preset canvas element, i.e., the canvas element, generating a browser fingerprint summary corresponding to the browser; using the axios library to embed the corresponding browser fingerprint summary of the browser into the data acquisition request. In a specific implementation, a canvas element is used to create a hidden canvas for drawing the fingerprint of the browser. JavaScript is used to obtain some characteristic information of the browser, such as screen resolution, color depth, time zone, language, user agent, plug-in list, etc. The above characteristic information is spliced into a string according to certain rules and drawn on the canvas. Then, the canvas.toDataURL() method is used to convert the canvas into a base64-encoded image data. JavaScript is used to perform an md5 (Message-Digest Algorithm 5) hash operation on the image data to obtain a 32-bit string as the browser's fingerprint md5, that is, the browser fingerprint digest. JavaScript is used to save the fingerprint md5 in a cookie and set the expiration time to one day. Finally, the axios library is used to intercept all front-end and back-end interaction requests, and the fingerprint md5 is added as a field in the request header.
[0055] In this embodiment, before sending the data acquisition request containing the browser fingerprint summary to the server, it also includes: using JavaScript and the browser fingerprint summary to create a font file address determination rule, and specifying the address of the target font file in the preset cloud platform through the font file address determination rule. In a specific implementation, JavaScript is used to dynamically create a @font-face style rule, i.e., a font file address determination rule, based on the fingerprint md5, for defining the obfuscated font, i.e., the address information of the target font file on the cloud platform; the specific steps are as follows: (1) Create a style element and insert it into the document header; (2) Get the sheet attribute of the style element, i.e., the CSS (Cascading StyleSheets) style sheet object; (3) Use the sheet.insertRule() method to insert a @font-face rule, specifying the font name as obfuscation, and the URL (Uniform Resource Locator) of the font file as Alibaba Cloud OSS (Object Storage Service), i.e., the font file address corresponding to the fingerprint md5 on the preset cloud platform. (4) Set the src (Source) attribute of the @font-face rule. Use font files of different formats, such as eot (Embedded Open Type), woff (Web Open Font Format), ttf (True TypeFont), etc., according to the compatibility of different browsers. The specific code for setting the URL of the font file to its address on Alibaba Cloud OSS is as follows: <style type="text / css">@font-face{font-family:'obfuscation';src:url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.eot'); / * IE9 * / src:url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.eot?#iefix')format('embedded-opentype'), / *IE6-IE8* / url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.woff') format('woff2'),url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.woff')format('woff'), / *chrome、firefox* / url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.ttf')format('truetype'), / *chrome、firefox、opera、Safari,Android,iOS 4.2+* / url('http: / / 阿里云OSS / PATH / font-{指纹的md5}.svg#font-{指纹的md5}')format('svg'); / *iOS 4.1-* / }.obfuscation{font-family:"obfuscation";font-size:16px;font-style:normal;}< / style> U+E002U+E022 In this embodiment, the browser fingerprint summary is generated by using the characteristic information of the browser, and the storage address of the target font file on the cloud platform is specified by using the font file address determination rule generated according to the browser fingerprint summary, thereby ensuring that the browser end can obtain the target font file in the cloud platform.
[0056] Step S12, obtaining a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom coding rule; the target data is the data determined by the server corresponding to the data acquisition request.
[0057] In this embodiment, the browser needs to obtain the response message containing the target custom code sent by the server. It is understandable that the browser needs to use the target font file obtained from the cloud platform to display the target custom code contained in the response message.
[0058] Step S13: acquiring the target font file from the preset cloud platform based on the browser fingerprint summary, and using the target font file to display the target custom code corresponding to the target data in the response message.
[0059] In this embodiment, the target custom encoding corresponding to the target data is displayed using the target font file, specifically including: judging whether there is a target obfuscation field tag, i.e., the X-Obfuscation-Fields field, in the response message; if there is a target obfuscation field tag in the response message, parsing the target obfuscation field tag to determine the data to be obfuscated in the target data according to the field name corresponding to the field list in the target obfuscation field tag; setting the class name corresponding to the data to be obfuscated to the target obfuscation class name, i.e., obfuscation, and displaying the target custom encoding corresponding to the data to be obfuscated in the target data according to the target obfuscation class name and the target font file; it should be noted that the target obfuscation class name is used to match the target custom encoding corresponding to the data to be obfuscated with the target font file. In a specific implementation, the browser first defines a CSS class name as obfuscation, sets its font-family attribute to obfuscation, and uses a framework such as JavaScript or Vue. After obtaining the business data contained in the response message returned by the server, the class name corresponding to the field to be obfuscated, that is, the data to be obfuscated, is set to obfuscation when displaying. The specific steps are as follows: (1) After obtaining the response message returned by the server, check whether the response header of the response message contains the X-Obfuscation-Fields field. (2) If there is a response header containing X-Obfuscation-Fields, the front end needs to parse the value of this response header to obtain a list of all obfuscated fields; correspondingly, if the response header of the response message does not contain the X-Obfuscation-Fields field, it means that there is no data to be obfuscated in the target data. (3) According to the parsed obfuscated field list, that is, the above-mentioned field list, the class name of the target custom encoding corresponding to these fields is set to obfuscation, so that the target custom encoding is rendered using the created target font file. By parsing the target obfuscation field tags, the data to be obfuscated in the target data is determined according to the field list obtained by parsing, and the target custom encoding is matched with the target font file according to the target obfuscation class name, ensuring the reliability of the mapping process.
[0060] It can be seen that the present application specifies the storage address of the target font file on the cloud platform by using the font file address determination rule generated according to the browser fingerprint summary, thereby ensuring that the browser can obtain the target font file in the cloud platform; parses the target obfuscation field mark, determines the data to be obfuscated in the target data according to the field list obtained by the analysis, and matches the target custom encoding with the target font file according to the target obfuscation class name, thereby ensuring the reliability of the mapping process; and by displaying the target data in a font file, avoids the problem of crawler programs stealing target data using OCR technology.
[0061] To make the digital encryption transmission method provided by this application more complete, see Figure 2 As shown, the embodiment of the present application discloses a digital encryption transmission method, which is applied to a server, including:
[0062] Step S21: receiving a data acquisition request from a browser end including a browser fingerprint digest corresponding to the browser end.
[0063] In this embodiment, the server needs to receive a data acquisition request from the browser to generate a target font file and a target custom encoding according to the browser fingerprint summary in the data acquisition request.
[0064] Step S22: Generate a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and upload the target font file to a preset cloud platform with the browser fingerprint summary as the file name.
[0065] In this embodiment, generating a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary may specifically include: obtaining the browser fingerprint summary from the data acquisition request and verifying whether the browser fingerprint summary is legal; if the browser fingerprint summary is legal, obtaining the mapping relationship corresponding to the browser fingerprint summary from the local; if the mapping relationship does not exist, randomly mapping the code in the blank coding area of the Unicode with the data to be obfuscated in the target data, storing the corresponding mapping relationship locally, and associating the mapping relationship with the browser fingerprint summary; extracting the preset glyph object corresponding to the data to be obfuscated from the initial font file already available on the browser side, defining a font file generation function, using the font file generation function, and generating the target font file based on the preset glyph object and the mapping relationship, and setting the corresponding class name of the target font file to the target obfuscation class name. In a specific implementation, firstly, the browser fingerprint md5 is obtained from the request parameters of the data acquisition request, and its legality is checked. If the fingerprint md5 is illegal, an exception is thrown, and the target font file corresponding to the browser fingerprint summary is not generated; if the browser fingerprint summary is legal, the local Redis database of the server is connected, and the digital Unicode mapping relationship corresponding to the fingerprint md5 is queried; if it exists, a success response is directly returned, and the target font file is generated according to the above mapping relationship; if the digital Unicode mapping relationship corresponding to the fingerprint md5 does not exist in the local Redis database, 10 codes are randomly selected from the Unicode U+E000-U+F8FF blank coding area, and randomly mapped with 0~9. Save this mapping relationship in the Redis database and associate it with the fingerprint md5; use the font-carrier module to extract the glyph objects corresponding to 0~9 from the given existing font file, that is, the initial font file, such as Songti, that is, the preset glyph objects, recorded as font0~font9; create a blank font object and traverse the Unicode codes and glyph objects corresponding to 0~9; set the name of each glyph object to the corresponding Unicode code and add it to the blank font object; define an interface function generateFont(req, res), that is, the font file generation function, and use the font file generation function and font.output() method to export the font object into font files of different formats, such as ttf, eot, woff, etc., and set the file name to obfuscation-{fingerprint md5}.*, that is, the target obfuscation class name.The corresponding code for the above process of traversing the Unicode codes and glyph objects corresponding to 0~9 and setting the name of each glyph object to the corresponding Unicode code is: var font=fontCarrier.create() for (var i=0;i<10;i++) {var glyph =transFont.getGlyph(i.toString()) glyph.setName(unicodeMap[i]) font.setGlyph(glyph)}.
[0066] It is understandable that all digital data contained in the data to be obfuscated are composed of 0~9, and 0~9 is randomly mapped with the codes in the blank coding area, and the target custom code obtained can cover all digital data contained in the obfuscated data. It should be noted that before generating the target font file according to the browser fingerprint, it is also necessary to install and introduce the font-carrier module for operating the font file; install and introduce the redis module for connecting and operating the Redis database; install and introduce the ali-oss module for connecting and operating the Alibaba Cloud OSS service. In this embodiment, by generating a special font file that cannot be recognized by OCR technology, the security of displaying the target data on the browser side is guaranteed. By uploading the generated font file to the cloud platform instead of directly embedding the font file into the response message and sending it to the browser side, the volume of the response message is reduced, avoiding the waste of unnecessary storage resources, and improving the efficiency of message transmission.
[0067] Step S23: Map the target data to the corresponding target custom code according to the preset custom code rule.
[0068] In this embodiment, the process of mapping the target data to the target custom code specifically includes: marking the data interface containing the target data by a preset obfuscation mark, namely @ObfuscationMethod, to obtain the marked data interface, and analyzing the return type corresponding to the marked data interface; obtaining the field list corresponding to the data to be obfuscated contained in the return type corresponding to the marked data interface; obtaining the browser fingerprint summary from the data acquisition request, and verifying whether the browser fingerprint summary is legal; if the browser fingerprint summary is legal, obtaining the mapping relationship corresponding to the browser fingerprint summary from the local according to the browser fingerprint summary; if the mapping relationship exists, mapping the data to be obfuscated in the target data to the corresponding target custom code according to the mapping relationship; in a specific implementation method, the server first defines a custom annotation @ObfuscationMethod for marking the interface to be obfuscated, a custom annotation @ObfuscationField for marking the field to be obfuscated, a section class ObfuscationAspect for intercepting all Controller methods annotated with @ObfuscationMethod, and a post notification method obfuscate(JoinPointjoinPoint, Object result), which is used to perform data obfuscation after the target method, that is, the Controller method. The parameter joinPoint represents the connection point object, and result represents the return value of the target method. In the aspect class, the RedisTemplate object is injected to operate the Redis database; after the relevant definition, in the post-notification method, the @ObfuscationMethod annotation object on the target method is obtained; the type of the target method return value is obtained, and the fields annotated with @ObfuscationField in this type are obtained, that is, the list of fields corresponding to the data to be obfuscated; in the post-notification method, the fingerprint md5 is obtained from the request header, and its legitimacy and validity are checked; in the post-notification method, the corresponding digital Unicode mapping relationship is queried from the Redis database according to the fingerprint md5. If it does not exist, an exception is thrown; if it exists, the list of fields to be obfuscated is traversed, and according to the digital Unicode mapping relationship, the numbers in the corresponding fields in the returned data, that is, the data to be obfuscated, are replaced with the custom target encoding.The specific code implementation of the above process of replacing the obfuscated data with the custom target code is as follows: for(String field:fields){String value=result.get(field);StringBuilder sb=new StringBuilder();for(char c:value.toCharArray()){if(Character.isDigit(c)){sb.append(unicodeMap.get(c-'0'));}else{sb.append(c);}}result.put(field, sb.toString());}. In this embodiment, the data is mapped through the mapping relationship between the target data and the custom code, which ensures the reliability of the data mapping process.
[0069] Step S24: embed the target custom code into a response message and send it to the browser end, so that the browser end receives the response message, obtains the target font file from the preset cloud platform according to the browser fingerprint summary, and uses the target font file to display the target custom code corresponding to the target data in the response message.
[0070] In this embodiment, before sending the response message to the browser, it specifically includes: after identifying the field list contained in the return type corresponding to the marked data interface, adding the field name of the field list to the target obfuscation field tag, that is, X-Obfuscation-Fields; adding the target obfuscation field tag containing the field name and the target custom code to the response message to send the response message to the browser. In a specific implementation, first define a unified response header field for identifying obfuscated fields, for example, it can be defined as X-Obfuscation-Fields; after identifying the fields with @ObfuscationField annotations in the interface return type, add the names of these fields to the response header. For example, if the fields price and quantity are obfuscated, the value of X-Obfuscation-Fields should be price, quantity; send the response containing the obfuscated fields and X-Obfuscation-Fields to the front end. By embedding the target obfuscation field tag containing the field name of the field list into the response message and sending it to the browser, it can be ensured that the browser determines the data to be obfuscated in the target data.
[0071] It can be seen that the present application maps data through the mapping relationship between target data and custom encoding, thereby ensuring the reliability of the data mapping process; by embedding the target obfuscation field marker containing the field name of the field list into the response message and sending it to the browser, it can ensure that the browser can determine the data to be obfuscated in the target data; by uploading the generated font file to the cloud platform instead of directly embedding the font file into the response message and sending it to the browser, the size of the response message is reduced, avoiding the waste of unnecessary storage resources, and improving the message transmission efficiency.
[0072] See also Figure 3 As shown, the embodiment of the present application discloses a digital encryption transmission device, which is applied to a browser side, including:
[0073] The request sending module 11 is used to send a data acquisition request containing the browser fingerprint summary corresponding to the browser end to the server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to a preset cloud platform with the browser fingerprint summary as the file name;
[0074] The message acquisition module 12 is used to acquire a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom code rule; the target data is the data corresponding to the data acquisition request determined by the server;
[0075] The data display module 13 is used to obtain the target font file from the preset cloud platform based on the browser fingerprint summary, and use the target font file to display the target custom code corresponding to the target data in the response message.
[0076] It can be seen that when the present application displays the target data on the client, it displays the target data by using the font file generated by the server, rather than displaying the target data in the form of a picture, thereby avoiding the problem of crawlers using OCR technology to steal the target data in the picture; by using font files instead of obfuscated pictures to display data, the readability of the target data is guaranteed.
[0077] In some specific embodiments, the request sending module 11 further includes:
[0078] A summary generating unit, used for acquiring the characteristic information of the browser end by using JavaScript, and generating the browser fingerprint summary corresponding to the browser end based on the characteristic information corresponding to the browser end and a preset canvas element;
[0079] A digest embedding unit, used for embedding the browser fingerprint digest corresponding to the browser end into the data acquisition request by using the axios library;
[0080] The address specifying unit is used to create a font file address determination rule by using JavaScript and the browser fingerprint summary, and specify the address of the target font file in the preset cloud platform through the font file address determination rule.
[0081] In some specific embodiments, the data display module 13 specifically includes:
[0082] a data determination unit, configured to determine whether a target obfuscation field tag exists in the response message, and if the target obfuscation field tag exists in the response message, parse the target obfuscation field tag to determine the required obfuscated data in the target data according to the field names corresponding to the field list in the target obfuscation field tag;
[0083] A data display unit is used to set the class name of the target custom encoding corresponding to the data to be obfuscated as a target obfuscation class name, and display the target custom encoding corresponding to the data to be obfuscated in the target data according to the target obfuscation class name and the target font file; wherein the target obfuscation class name is used to match the target custom encoding corresponding to the data to be obfuscated with the target font file.
[0084] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0085] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the digital encryption transmission method disclosed in any of the above embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0086] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0087] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0088] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the digital encryption transmission method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0089] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed digital encryption transmission method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0090] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0091] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0092] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0093] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0094] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A digital encryption transmission method, characterized in that: Applied to the browser side, including: Sending a data acquisition request containing the browser fingerprint summary corresponding to the browser end to the server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to the preset cloud platform with the browser fingerprint summary as the file name; Obtaining a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom code rule; the target data is data corresponding to the data acquisition request determined by the server; The target font file is obtained from the preset cloud platform based on the browser fingerprint summary, and the target font file is used to display the target custom code corresponding to the target data in the response message.
2. The digital encryption transmission method according to claim 1, characterized in that: Before sending the data acquisition request including the browser fingerprint summary corresponding to the browser to the server, the method further includes: Using JavaScript to obtain feature information of the browser, and generating the browser fingerprint summary corresponding to the browser based on the feature information corresponding to the browser and a preset canvas element; The browser fingerprint summary corresponding to the browser side is embedded into the data acquisition request using the axios library.
3. The digital encryption transmission method according to claim 1, characterized in that: Before sending the data acquisition request including the browser fingerprint summary corresponding to the browser to the server, the method further includes: JavaScript and the browser fingerprint summary are used to create a font file address determination rule, and the address of the target font file in the preset cloud platform is specified by the font file address determination rule.
4. The digital encryption transmission method according to claim 1, characterized in that: The using the target font file to display the target custom code corresponding to the target data in the response message includes: Determine whether there is a target obfuscation field tag in the response message, and if there is the target obfuscation field tag in the response message, parse the target obfuscation field tag to determine the data to be obfuscated in the target data according to the field name corresponding to the field list in the target obfuscation field tag; The class name of the target custom encoding corresponding to the data to be obfuscated is set as a target obfuscation class name, and the target custom encoding corresponding to the data to be obfuscated in the target data is displayed according to the target obfuscation class name and the target font file; wherein the target obfuscation class name is used to match the target custom encoding corresponding to the data to be obfuscated with the target font file.
5. A digital encryption transmission method, characterized in that: Applied to the server, including: Receiving a data acquisition request from a browser end including a browser fingerprint summary corresponding to the browser end; Generate a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and upload the target font file to a preset cloud platform with the browser fingerprint summary as the file name; Map the target data to the corresponding target custom code according to the preset custom code rule; The target custom code is embedded in a response message and sent to the browser end so that the browser end receives the response message, obtains the target font file from the preset cloud platform according to the browser fingerprint summary, and uses the target font file to display the target custom code corresponding to the target data in the response message.
6. The digital encryption transmission method according to claim 5, characterized in that: The step of generating a target font file corresponding to the browser fingerprint digest according to the browser fingerprint digest includes: Obtaining the browser fingerprint summary from the data acquisition request, and verifying whether the browser fingerprint summary is legal; If the browser fingerprint summary is legal, the mapping relationship corresponding to the browser fingerprint summary is obtained locally; If the mapping relationship does not exist, randomly map the code in the blank coding area of the Unicode with the data to be obfuscated in the target data, store the corresponding mapping relationship locally, and associate the mapping relationship with the browser fingerprint summary; Extracting a preset glyph object corresponding to the data to be obfuscated from an existing initial font file on the browser side, defining a font file generation function, utilizing the font file generation function, and generating the target font file based on the preset glyph object and the mapping relationship, and setting the file name of the target font file to the browser fingerprint summary.
7. The digital encryption transmission method according to claim 5, characterized in that: Mapping the target data to the corresponding target custom code according to the preset custom code rule includes: Marking the data interface containing the target data by presetting the obfuscation field mark to obtain a marked data interface, and analyzing the return type corresponding to the marked data interface; Obtain a list of fields corresponding to the data to be obfuscated contained in the return type corresponding to the marked data interface; Obtaining the browser fingerprint summary from the data acquisition request, and verifying whether the browser fingerprint summary is legal; If the browser fingerprint summary is legal, then obtaining the mapping relationship corresponding to the browser fingerprint summary from the local computer according to the browser fingerprint summary; If the mapping relationship exists, the data to be obfuscated in the target data is mapped to the corresponding target custom code according to the mapping relationship and the field list.
8. The digital encryption transmission method according to claim 7, characterized in that: Before the target custom code is embedded in the response message and sent to the browser, the method further includes: After identifying the field list contained in the return type corresponding to the marked data interface, adding the field names of the field list to the target obfuscation field tags; The target obfuscated field tag including the field name and the target custom code are added to the response message to send the response message to the browser.
9. A digital encryption transmission device, characterized in that: Applied to the browser side, including: A request sending module, used to send a data acquisition request containing a browser fingerprint summary corresponding to the browser end to a server end, so that the server end generates a target font file corresponding to the browser fingerprint summary according to the browser fingerprint summary, and uploads the target font file to a preset cloud platform with the browser fingerprint summary as the file name; A message acquisition module, used to acquire a response message sent by the server corresponding to the data acquisition request; wherein the response message includes a target custom code obtained by the server after converting the target data based on a preset custom code rule; the target data is the data corresponding to the data acquisition request determined by the server; A data display module is used to obtain the target font file from the preset cloud platform based on the browser fingerprint summary, and use the target font file to display the target custom code corresponding to the target data in the response message.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the digital encryption transmission method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the digital encryption transmission method according to any one of claims 1 to 8 is implemented.
