Method, device, electronic device and medium for protecting sensitive information in applications

By generating digital fingerprints based on application characteristics and using encryption keys to encrypt sensitive information, the problem of easy leakage of key storage and application complexity is solved, and the security of sensitive information is improved.

CN112825095BActive Publication Date: 2024-10-18BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201911152102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-20
Publication Date
2024-10-18
Estimated Expiration
2039-11-20

AI Technical Summary

Technical Problem

In an application server, if the key used to encrypt sensitive information is stored on the local server, it is easy to obtain and sensitive information is easily leaked; if it is stored on a remote server, it increases the complexity of the application and cannot effectively protect sensitive information.

Method used

By obtaining the characteristic information of the application, a digital fingerprint is generated, an encryption key is generated based on the digital fingerprint, the sensitive information is encrypted, the encryption key is used to encrypt the sensitive information or its secret key, and ciphertext is generated for storage to avoid encryption. Keys are stored on the ground.

Benefits of technology

It improves the security of sensitive information in applications, avoids key leaks, reduces application complexity, and enhances the ability to protect sensitive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112825095B_ABST
    Figure CN112825095B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for protecting sensitive information in an application, comprising: obtaining feature information of the application; generating a digital fingerprint based on the feature information, wherein the digital fingerprint includes data for representing the characteristics of the application itself; generating an encryption key based on the digital fingerprint; and encrypting the sensitive information based on the encryption key, wherein encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or a secret key of the sensitive information using the encryption key. The present disclosure also provides an apparatus, an electronic device, and a computer-readable storage medium for protecting sensitive information in an application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a method, device, electronic device, and medium for protecting sensitive information in an application. Background Art

[0002] Application servers usually store some sensitive information, such as credentials for accessing external services. In order to ensure the security of the credentials, these credentials are usually stored in the application server after being encrypted.

[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: if the key used to encrypt sensitive information is stored on a local server, the key is easy to be obtained and the sensitive information is easy to be leaked; if the key is stored on a remote server, the complexity of the application is increased. Summary of the invention

[0004] In view of this, the present disclosure provides a method, apparatus, electronic device, and medium for protecting sensitive information in an application.

[0005] One aspect of the present disclosure provides a method for protecting sensitive information in an application, comprising: obtaining feature information of the application; generating a digital fingerprint based on the feature information, wherein the digital fingerprint includes data for representing the application's own features; generating an encryption key based on the digital fingerprint; and encrypting the sensitive information based on the encryption key, wherein encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or a secret key of the sensitive information using the encryption key.

[0006] According to an embodiment of the present disclosure, the application includes a Java application, and the characteristic information includes: the storage path of each of the multiple jar files of the Java application; or the summary information of each of the multiple jar files, and the summary information is generated by encrypting the multiple jar files according to a summary algorithm.

[0007] According to an embodiment of the present disclosure, the application includes a Java application, the characteristic information includes: the storage path of each of the multiple jar files of the Java application, and the obtaining of the characteristic information of the application includes: obtaining the class loader of the application; determining whether the application is deployed in a Tomcat container; and in the case where it is determined that the application is deployed in a Tomcat container, reading the storage path of the multiple jar files from the first class loader; or in the case where it is determined that the application is not deployed in a Tomcat container, reading the storage path of the multiple jar files from the second class loader.

[0008] According to an embodiment of the present disclosure, the characteristic information includes the storage paths of the multiple jar files of the java application, and generating a digital fingerprint based on the characteristic information includes: sorting the storage paths of the multiple jar files according to a preset rule, and merging the sorted storage paths of the multiple jar files to generate a data string; and encrypting the data string using a digest algorithm so as to generate a digital fingerprint using the data string.

[0009] According to an embodiment of the present disclosure, sorting the storage paths of the multiple jar files according to a preset rule includes: arranging the storage paths of the multiple jar files in ascending or descending order according to the size of the character strings of the storage paths.

[0010] According to an embodiment of the present disclosure, the secret key encryption of the sensitive information based on the encryption key includes: generating a random number, the random number serving as the secret key of the sensitive information; encrypting the secret key using the encryption key to generate a ciphertext of the secret key; encrypting the sensitive information based on the secret key; and storing the ciphertext of the secret key to facilitate decryption of the sensitive information.

[0011] Another aspect of the present disclosure provides an apparatus for protecting sensitive information in an application, comprising: an acquisition module for acquiring feature information of the application; a first generation module for generating a digital fingerprint based on the feature information, wherein the digital fingerprint includes data for representing the application's own features; a second generation module for generating an encryption key based on the digital fingerprint; and an encryption module for encrypting the sensitive information based on the encryption key, wherein encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or a secret key of the sensitive information using the encryption key.

[0012] According to an embodiment of the present disclosure, the encryption module includes: a first generation submodule, used to generate a random number, the random number being used as a secret key for the sensitive information; a second generation submodule, used to encrypt the secret key using the encryption key to generate a ciphertext of the secret key; an encryption submodule, used to encrypt the sensitive information based on the secret key; and a storage submodule, used to store the ciphertext of the secret key to facilitate decryption of the sensitive information.

[0013] Another aspect of the present disclosure provides an electronic device, comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute any one of the above-mentioned methods.

[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0015] Another aspect of the present disclosure provides a computer program, which includes computer executable instructions, and the instructions are used to implement the method described above when executed.

[0016] According to the embodiments of the present disclosure, the problem of easy leakage of sensitive information in applications can be at least partially solved, and thus the technical effect of improving the security of sensitive information in applications can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0018] Figure 1 A flowchart of a method for protecting sensitive information in an application according to an embodiment of the present disclosure is schematically shown;

[0019] Figure 2 A flowchart of a method for obtaining feature information of an application according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 3 A flowchart of a method for generating a digital fingerprint based on feature information according to an embodiment of the present disclosure is schematically shown;

[0021] Figure 4 The flowchart of the method for encrypting the secret key of sensitive information based on the encryption key according to the embodiment of the present disclosure is schematically shown;

[0022] Figure 5 A schematic diagram schematically illustrates an apparatus for protecting sensitive information in an application according to an embodiment of the present disclosure; and

[0023] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0027] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0028] The embodiment of the present disclosure provides a method for protecting sensitive information in an application, comprising: obtaining feature information of the application; generating a digital fingerprint according to the feature information, wherein the digital fingerprint includes data for representing the features of the application itself; generating an encryption key based on the digital fingerprint; and encrypting the sensitive information based on the encryption key. Encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or a secret key of the sensitive information using the encryption key.

[0029] According to an embodiment of the present disclosure, in an application server, it is usually necessary to store credentials for accessing external services in a configuration file, such as a database account password. In order to ensure the security of sensitive information such as credentials, for example, the sensitive information can be encrypted, and the encrypted ciphertext can be stored in a database. The protection of the key used to encrypt sensitive information becomes the key to protecting the security of sensitive information. Since the key itself also needs to be able to be used by the application service to decrypt the credential ciphertext (such as a database password), the key itself cannot use irreversible algorithms such as Secure Hash. If the key is protected again using symmetric encryption, the key that encrypts the key becomes the object of protection again. This forms a dead loop of protection. In actual practice, many application services simply store the key in plain text in a local file without protecting the key. If the key is stored in a remote server, the complexity of the application service will increase, and the external dependency generated will also reduce the availability of the application service. Therefore, in the related art, it is impossible to effectively protect sensitive information in the application.

[0030] Figure 1 The flowchart of the method for protecting sensitive information in an application according to an embodiment of the present disclosure is schematically shown.

[0031] like Figure 1 As shown, the method includes operations S101 to S104.

[0032] In operation S101 , characteristic information of an application is acquired.

[0033] According to an embodiment of the present disclosure, the feature information of an application may be features of the application itself, and the application may be uniquely identified based on the features.

[0034] According to an embodiment of the present disclosure, the application may be, for example, a Java application, and the characteristic information may be, for example, the storage path of each of the multiple jar files of the Java application, or the summary information of each of the multiple jar files, where the summary information is generated by encrypting the multiple jar files according to a summary algorithm.

[0035] It should be understood that the application may be other applications, not limited to Java applications. The characteristic information of the application may be any characteristic of the application, and the characteristic may not be possessed by other applications.

[0036] In operation S102, a digital fingerprint is generated according to the characteristic information, wherein the digital fingerprint includes data for representing the characteristics of the application itself.

[0037] The digital fingerprint may be binary data generated by utilizing the characteristics of the application itself, and is only related to the application itself. Different applications may generate different digital fingerprints.

[0038] In operation S103, an encryption key is generated based on the digital fingerprint.

[0039] According to the embodiments of the present disclosure, the digital fingerprint can be directly used as the encryption key. Alternatively, the result of transforming the digital fingerprint according to a predetermined rule can be used as the encryption key, for example, the encryption result after encrypting the digital fingerprint can be used as the encryption key.

[0040] In operation S104, the sensitive information is encrypted based on the encryption key. Encrypting the sensitive information based on the encryption key includes: using the encryption key to encrypt the sensitive information or a secret key of the sensitive information.

[0041] According to one embodiment of the present disclosure, the sensitive information is directly encrypted using an encryption key. According to another embodiment of the present disclosure, for example, the encryption key encrypts the secret key of the sensitive information. The secret key is a key used to encrypt the sensitive information.

[0042] Specifically, for example, in an embodiment where the digital fingerprint is directly used as an encryption key, the digital fingerprint can be used as a key to encrypt sensitive information, and the sensitive information can be encrypted using symmetric encryption technology. Alternatively, the digital fingerprint can be used as a key to encrypt a secret key, and the secret key can be encrypted using symmetric encryption technology.

[0043] According to the embodiments of the present disclosure, the method generates a digital fingerprint based on the characteristics of the application itself, and encrypts the sensitive information based on the encryption key generated by the digital fingerprint, and the encryption key generated by the digital fingerprint does not need to be stored on the ground. When decryption is required, the server can determine the encryption key based on the characteristics of the application itself, thereby ensuring that the encryption key is not leaked and improving the security of sensitive information. Among them, on-site storage can refer to storing the encryption key in a storage unit

[0044] Figure 2 The flowchart of the method for obtaining characteristic information of an application according to an embodiment of the present disclosure is schematically shown.

[0045] like Figure 2 As shown, the method may include operations S111 to S131. In the method, the characteristic information includes storage paths of multiple jar files of the java application.

[0046] In operation S111 , a class loader of the application is acquired.

[0047] For example, the system class loader for a Java application can be obtained through ClassLoader.getSystemClassLoader(), and for another example, the thread class loader can be obtained through Thread.currentThread().getContextClassLoader().

[0048] According to an embodiment of the present disclosure, for example, an SDK may be designed, through which a class loader of an application may be obtained.

[0049] In operation S121, it is determined whether the application is deployed in a Tomcat container (a java web server).

[0050] In operation S131, when it is determined that the application is deployed in a Tomcat container, the storage paths of multiple jar files are read from a first type loader; or when it is determined that the application is not deployed in a Tomcat container, the storage paths of multiple jar files are read from a second type loader.

[0051] According to an embodiment of the present disclosure, if the application is deployed in a Tomcat container, multiple jar files of the application may be loaded by a thread class loader, so that the storage paths of the multiple jar files may be read from the thread class loader.

[0052] If the application is not deployed in a Tomcat container, the multiple jar files of the application may be loaded by a system class loader, and thus the storage paths of the multiple jar files may be read from the system class loader.

[0053] According to the embodiment of the present disclosure, SystemClassLoader and ContextClassLoader are actually both URLClassloaders. For example, the following code can be used to obtain the URL list of the Jar loaded by them: URL[]urls=((URLClassLoader)ctxl).getURLs().

[0054] According to an embodiment of the present disclosure, the method can obtain the storage paths of multiple jar files from different class loaders for different types of applications. Therefore, the method can be applicable to applications deployed in Tomcat containers and applications not deployed in Tomcat containers, thus expanding the scope of application of the method.

[0055] According to an embodiment of the present disclosure, the characteristic information includes the storage paths of multiple jar files of a java application, and generating a digital fingerprint based on the characteristic information includes: sorting the storage paths of the multiple jar files according to a preset rule, and merging the sorted storage paths of the multiple jar files to generate a data string; and encrypting the data string using a digest algorithm so as to generate a digital fingerprint using the data string.

[0056] Figure 3 The flowchart of the method for generating a digital fingerprint according to feature information according to an embodiment of the present disclosure is schematically shown.

[0057] like Figure 3 As shown, the method may include operations S112 to S122.

[0058] In operation S112, the storage paths of the plurality of jar files are sorted according to a preset rule, and the sorted storage paths of the plurality of jar files are merged to generate a data string.

[0059] According to an embodiment of the present disclosure, for example, the storage paths of multiple jar files can be arranged in ascending or descending order according to the size of the storage path string. Specifically, for example, three jar files are included, and their storage paths are aac, vuk, and kde, respectively. Aac, vuk, and kde are compared as strings, that is, the comparison starts from the first character on the left of the string, the larger one is larger, and the smaller one is smaller. If they are equal, the subsequent characters are compared. Arranged in ascending order according to the size of the string comparison can be aac, kde, and vuk. The data string generated by merging the three storage paths can be aackdevuk.

[0060] It should be understood that aac, kde, and vuk are merely schematic representations of the storage path in order to illustrate the present embodiment, and do not represent the actual storage path format.

[0061] In operation S122, the data string is encrypted using a digest algorithm so as to generate a digital fingerprint using the data string.

[0062] For example, the SHA256 (Secure Hash Algorithm 2) algorithm may be used to normalize aackdevuk into a 16-byte digital fingerprint.

[0063] Figure 4 The flowchart schematically shows a method for encrypting a secret key of sensitive information based on an encryption key according to an embodiment of the present disclosure.

[0064] like Figure 4 As shown, the method may include operations S114 to S144.

[0065] In operation S114, a random number is generated, and the random number is used as a secret key for the sensitive information.

[0066] According to an embodiment of the present disclosure, the random number may be, for example, a random binary number, which may be used as a secret key for sensitive information.

[0067] In operation S124, the secret key is encrypted using the encryption key to generate a ciphertext of the secret key. For example, the encryption key can be used as a key for encrypting the secret key, and the secret key is encrypted using a symmetric key encryption algorithm.

[0068] In operation S134, the sensitive information is encrypted based on the secret key. For example, a binary number can be used as the secret key of the sensitive information, and the sensitive information is encrypted using a symmetric key encryption algorithm.

[0069] In operation S144, the ciphertext of the secret key is stored to facilitate decryption of the sensitive information. For example, the encrypted ciphertext of the secret key can be stored locally.

[0070] According to the embodiment of the present disclosure, the method uses a random number as a secret key of sensitive information, uses the secret key to encrypt sensitive information to generate a ciphertext of the sensitive information, and the encryption key generated by the digital fingerprint is used to encrypt the secret key to generate the ciphertext of the secret key, and the ciphertext of the secret key is stored for decryption. This method further improves the security of sensitive information.

[0071] Figure 5 A schematic diagram of an apparatus 500 for protecting sensitive information in an application according to an embodiment of the present disclosure is schematically shown.

[0072] like Figure 5 As shown, the device 500 may include an acquisition module 510 , a first generation module 520 , a second generation module 530 and an encryption module 540 .

[0073] The acquisition module 510 may, for example, execute the above reference Figure 1 The described operation S101 is used to obtain characteristic information of the application.

[0074] The first generating module 520 may, for example, execute the above reference Figure 1 The described operation S102 is used to generate a digital fingerprint according to the characteristic information, wherein the digital fingerprint includes data for representing the characteristics of the application itself.

[0075] The second generation module 530 may, for example, execute the above reference Figure 1 The described operation S103 is used to generate an encryption key based on the digital fingerprint.

[0076] The encryption module 540 may, for example, execute the above-referenced Figure 1 The described operation S104 is used to encrypt the sensitive information based on the encryption key. Wherein, encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or the secret key of the sensitive information by using the encryption key.

[0077] According to an embodiment of the present disclosure, the application includes a Java application, and the characteristic information includes: the storage path of each of the multiple jar files of the Java application; or the summary information of each of the multiple jar files, and the summary information is generated by encrypting the multiple jar files according to a summary algorithm.

[0078] According to an embodiment of the present disclosure, the characteristic information includes the storage paths of multiple jar files of the java application, and obtaining the characteristic information of the application includes: obtaining the class loader of the application; determining whether the application is deployed in a Tomcat container; and when it is determined that the application is deployed in a Tomcat container, reading the storage paths of the multiple jar files from the first class loader; or when it is determined that the application is not deployed in a Tomcat container, reading the storage paths of the multiple jar files from the second class loader.

[0079] According to an embodiment of the present disclosure, the characteristic information includes the storage paths of the multiple jar files of the java application, and generating a digital fingerprint based on the characteristic information includes: sorting the storage paths of the multiple jar files according to a preset rule, and merging the sorted storage paths of the multiple jar files to generate a data string; and encrypting the data string using a digest algorithm so as to generate a digital fingerprint using the data string.

[0080] According to an embodiment of the present disclosure, sorting the storage paths of the multiple jar files according to a preset rule includes: arranging the storage paths of the multiple jar files in ascending or descending order according to the size of the character strings of the storage paths.

[0081] According to an embodiment of the present disclosure, the encryption module includes: a first generation submodule for generating a random number, the random number being used as a secret key for the sensitive information; a second generation submodule for encrypting the secret key using the encryption key to generate a ciphertext of the secret key; an encryption submodule for encrypting the sensitive information based on the secret key; and a storage submodule for storing the ciphertext of the secret key to facilitate decryption of the sensitive information.

[0082] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0083] For example, any multiple of the acquisition module 510, the first generation module 520, the second generation module 530, and the encryption module 540 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquisition module 510, the first generation module 520, the second generation module 530, and the encryption module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in a suitable combination of any of them. Alternatively, at least one of the acquisition module 510, the first generation module 520, the second generation module 530 and the encryption module 540 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.

[0084] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0085] like Figure 6As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0086] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0087] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0088] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0089] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0090] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0091] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0092] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0093] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for protecting sensitive information in an application, comprising: Acquire characteristic information of the application, wherein the application includes a Java application; Generate a digital fingerprint according to the characteristic information, wherein the characteristic information includes storage paths of the multiple jar files of the java application or summary information of the multiple jar files, the storage paths are obtained from a class loader corresponding to the type of the application according to the type of the application, and the digital fingerprint includes data for representing the characteristics of the application itself; generating an encryption key based on the digital fingerprint; and encrypting the sensitive information based on the encryption key; The step of generating a digital fingerprint according to the characteristic information includes: sorting the storage paths of the plurality of jar files according to a preset rule, and merging the sorted storage paths of the plurality of jar files to generate a data string; encrypting the data string using a digest algorithm, so as to generate a digital fingerprint using the data string; The encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or a secret key of the sensitive information by using the encryption key. 2 . The method according to claim 1 , wherein the summary information is generated by encrypting the multiple jar files according to a summary algorithm.

3. The method according to claim 2, wherein: The characteristic information includes storage paths of multiple jar files of the java application, and obtaining the characteristic information of the application includes: Obtaining a class loader for the application; Determining whether the application is deployed in a Tomcat container; and When it is determined that the application is deployed in a Tomcat container, the storage paths of the multiple jar files are read from the first class loader; or when it is determined that the application is not deployed in a Tomcat container, the storage paths of the multiple jar files are read from the second class loader.

4. The method according to claim 1, wherein: The step of sorting the storage paths of the plurality of jar files according to a preset rule comprises: The storage paths of the multiple jar files are arranged in ascending or descending order according to the size of the character strings of the storage paths.

5. The method according to claim 1, wherein: The secret key encryption of the sensitive information based on the encryption key comprises: Generate a random number, the random number serving as a secret key for the sensitive information; encrypting the secret key using the encryption key to generate a ciphertext of the secret key; encrypting the sensitive information based on the secret key; and The ciphertext of the secret key is stored to facilitate decryption of the sensitive information.

6. A device for protecting sensitive information in an application, comprising: An acquisition module, used to acquire characteristic information of the application, wherein the application includes a Java application; a first generating module, configured to generate a digital fingerprint according to the feature information, wherein the feature information includes storage paths of the multiple jar files of the java application or summary information of the multiple jar files, the storage paths are obtained from a class loader corresponding to the type of the application according to the type of the application, and the digital fingerprint includes data for representing the characteristics of the application itself; A second generating module, configured to generate an encryption key based on the digital fingerprint; and An encryption module, used for encrypting the sensitive information based on the encryption key; Among them, generating a digital fingerprint based on the characteristic information includes: sorting the storage paths of the multiple jar files according to a preset rule, and merging the sorted storage paths of the multiple jar files to generate a data string; encrypting the data string using a digest algorithm so as to generate a digital fingerprint using the data string; wherein encrypting the sensitive information based on the encryption key includes: encrypting the sensitive information or the secret key of the sensitive information using the encryption key.

7. The device according to claim 6, wherein the encryption module comprises: A first generating submodule, used for generating a random number, wherein the random number is used as a secret key for the sensitive information; A second generating submodule, used for encrypting the secret key by using the encryption key to generate a ciphertext of the secret key; an encryption submodule, configured to encrypt the sensitive information based on the secret key; as well as The storage submodule is used to store the ciphertext of the secret key to facilitate decryption of the sensitive information.

8. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method as described in any one of claims 1 to 5.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute any one of the methods of claims 1 to 5.

Citation Information

Patent Citations

  • Program protection method and device

    CN103853943A

  • A Java application protection method

    CN109460674A

  • Media file encryption key management method, system and device and storage medium

    CN109635586A

  • Data storage method, device and equipment

    CN110032874A

  • Data transmission method, electronic equipment and storage medium

    CN110324143A