WO2020044095A1 - 文件加密方法、装置、设备/终端/服务器及计算机可读存储介质 - Google Patents

文件加密方法、装置、设备/终端/服务器及计算机可读存储介质 Download PDF

Info

Publication number
WO2020044095A1
WO2020044095A1 PCT/IB2018/057162 IB2018057162W WO2020044095A1 WO 2020044095 A1 WO2020044095 A1 WO 2020044095A1 IB 2018057162 W IB2018057162 W IB 2018057162W WO 2020044095 A1 WO2020044095 A1 WO 2020044095A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
encrypted
encryption
type
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/IB2018/057162
Other languages
English (en)
French (fr)
Inventor
姚若旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ucweb Singapore Pte Ltd
Original Assignee
Ucweb Singapore Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ucweb Singapore Pte Ltd filed Critical Ucweb Singapore Pte Ltd
Publication of WO2020044095A1 publication Critical patent/WO2020044095A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Definitions

  • Embodiments of the present application relate to the field of data processing technologies, and in particular, to a file encryption method, device, device / terminal / server, and computer-readable storage medium. Background technique
  • a large amount of user privacy data is stored in smart devices, such as the user ’s identity data, behavior data, medical data, or other data that the user wants to protect.
  • the data security issues facing smart devices are also diverse. For example, there are Data security threats caused by network hacking attacks, virus intrusions, etc .; there are also data security problems caused by vulnerabilities in intelligent device management and insufficient strength of access control; and the management of high-confidential data storage devices. Coming security risks.
  • one of the technical problems solved by the embodiments of the present application is to provide a file encryption method, device, device / terminal / server, and computer-readable storage medium to ensure the security of user privacy data.
  • a file encryption method including: determining that a file to be encrypted is not saved in a system folder, wherein the file to be encrypted stores user privacy data; and encrypting according to a setting A rule is to perform encryption processing on the data content of the file to be encrypted, and set the file type of the file to be encrypted to a set encryption type after the encryption processing, where the set encryption type and the setting are Corresponding to the predetermined encryption rule, the set encryption type is used to indicate the The encrypted file is encrypted by the set encryption rule; and an encrypted file is generated according to the data content after the encryption process and the modified file type.
  • a file encryption device including: a determining module configured to determine that a file to be encrypted is not saved in a system folder, wherein the file to be encrypted stores user privacy Data; an encryption module configured to perform encryption processing on the data content of the file to be encrypted according to a set encryption rule, and set the file type of the file to be encrypted to the set encryption type after the encryption processing, where The set encryption type corresponds to the set encryption rule, and the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule; a generating module configured to be configured according to the encrypted processing The data content and the modified file type generate an encrypted file.
  • a device / terminal / server including: one or more processors; a storage device configured to store one or more programs; when the one or more programs Being executed by the one or more processors, so that the one or more processors implement the file encryption method according to the first aspect.
  • a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the file encryption method according to the first aspect is implemented.
  • the file encryption scheme it is first determined that a file to be encrypted is not stored under the system folder, so as to prevent the file to be encrypted that stores user privacy data from leaking through the system folder; then, according to the set encryption rule, The data content of the encrypted file is encrypted and its file type is set to the set encryption type.
  • the set encryption type is different from the conventional file type and corresponds to the set encryption rule. It is used to indicate that the current file has passed the set encryption rule. Encryption.
  • the encrypted file is difficult to be identified and read by general programs, which improves the density.
  • the encryption rules can be clearly marked to provide information for subsequent decryption.
  • the data content and the modified file type generate corresponding encrypted files. It can be seen that the file encryption solution provided in the embodiments of the present application can effectively ensure the security of user privacy data of smart devices and prevent the leakage of user privacy data.
  • FIG. I is a flowchart of steps of a file encryption method according to Embodiment 1 of the present application
  • FIG. 2 is a flowchart of steps of a file encryption method according to Embodiment 2 of the present application;
  • FIG. 3 is a structural block diagram of a file encryption device according to a third embodiment of the present application.
  • FIG. 4 is a structural block diagram of a file encryption device according to a fourth embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a device / terminal / server according to Embodiment 5 of the present application. detailed description
  • the file encryption method of this embodiment includes the following steps:
  • Step S102 It is determined that the file to be encrypted is not saved in the system folder.
  • the user's privacy data is stored in the file to be encrypted.
  • User privacy data includes, but is not limited to, user identity data, behavior data, medical data, or other data that the user wants to protect.
  • Step S104 The data content of the file to be encrypted is encrypted according to the set encryption rule, and the file type of the file to be encrypted is set to the set encryption type after the encryption process.
  • the set encryption type corresponds to the set encryption rule, and the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule.
  • Different set encryption rules correspond to different set encryption types.
  • the set encryption type is different from a conventional file type, and a person skilled in the art can customize any appropriate character string to characterize the encryption type as required.
  • the encryption rules can be downloaded and used from the server, or loaded and used after being downloaded locally. Corresponds to the setting of the encryption rule and the setting of the encryption type. On the one hand, the encryption type can reflect the encryption rule. In subsequent decryption, the information of the encryption rule corresponding to the encryption type can be directly obtained or used to quickly and easily encrypt the file. Provide accurate evidence for decryption; On the other hand, if the encryption rules are updated on the server side Then, the encryption type is also updated accordingly. When the client detects that a new encryption type is generated, it can be determined that the encryption rule has been updated, thereby downloading a new encryption rule from the server, and improving the encryption efficiency and security.
  • Step S106 Generate an encrypted file according to the encrypted data content and the modified file type.
  • the final encrypted file can be generated.
  • the file encryption scheme provided by this embodiment, first determine that a file to be encrypted is not saved under the system folder to avoid leakage of the file to be encrypted that contains user privacy data through the system folder; then, according to the set encryption rule, treat the encryption
  • the data content of the file is encrypted and its file type is set to the set encryption type.
  • the set encryption type is different from the conventional file type and corresponds to the set encryption rule. It is used to indicate that the current file has been encrypted by the set encryption rule. Therefore, on the one hand, the encrypted file is difficult to be identified and read by general programs, which improves the density.
  • the encryption rules can be clearly marked to provide information for subsequent decryption.
  • the data content and the modified file type generate corresponding encrypted files. It can be seen that the file encryption scheme provided in this embodiment can effectively ensure the security of the user's privacy data of the smart device and prevent the leakage of the user's privacy data.
  • the file encryption method in this embodiment may be executed by any appropriate device having data processing capabilities, including, but not limited to, various terminal devices or servers, such as a PC, a tablet computer, a mobile terminal, and the like.
  • various terminal devices or servers such as a PC, a tablet computer, a mobile terminal, and the like.
  • the file encryption method of this embodiment includes the following steps:
  • Step S202 Check whether a file to be encrypted is stored in the system folder; if so, remove the file to be encrypted from the system folder, and then perform step S204; if not, directly perform step S204.
  • the user's privacy data is stored in the file to be encrypted.
  • Step S204 The data content of the file to be encrypted is encrypted according to the set encryption rule, and the file type of the file to be encrypted is set to the set encryption type after the encryption process.
  • the set encryption type corresponds to the set encryption rule, and the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule.
  • this step may be implemented as: obtaining a set encryption rule, where the set encryption rule includes information of an encryption algorithm and information of an encryption type; and according to the encryption algorithm indicated by the encryption algorithm information, The data content is encrypted; then, the file type of the file to be encrypted is set to the encryption type indicated by the encryption type information.
  • the data content of the file to be encrypted represents the actual content of the file to be encrypted, including, but not limited to, user privacy data recorded in the file to be encrypted.
  • the encryption algorithm and the encryption type can be appropriately set by those skilled in the art according to actual needs, and the embodiment of the present application does not limit this.
  • the encryption algorithm may be any appropriate symmetric encryption algorithm, asymmetric encryption algorithm, HASH encryption algorithm, etc. .
  • setting the file type of the file to be encrypted to set the encryption type may include: performing detype processing on the file attribute information of the file to be encrypted, where the detype processing is used to remove the original file type of the file to be encrypted Information; after the detype processing is performed, the file type of the file to be encrypted is set to the set encryption type.
  • the detype processing the original file type of the file to be encrypted can be hidden during encryption, which is difficult to be identified and read, and the degree of encryption can be improved; while decrypting, the original file type can be quickly parsed and restored to improve the efficiency of the decryption operation.
  • the detype processing includes: obfuscating the original file type information identifying the file to be encrypted in the file attribute information of the file to be encrypted, or adding and setting the original file type information identifying the file to be encrypted in the file attribute information of the file to be encrypted.
  • Fixed character processing The set characters may be appropriately set by those skilled in the art according to actual needs, including but not limited to: characters, numbers, symbols, and the like, which are not limited in the embodiment of the present application.
  • Obfuscation is an information protection technology that replaces ideographic character combinations such as names with meaningless character combinations.
  • the obfuscation operation is performed by obfuscating the original file type information.
  • the information of the original file type of the file to be encrypted can be removed, and on the other hand, it also plays a role of data protection to a certain extent.
  • the data content in the file to be encrypted is encrypted, such as local encryption or server encryption; and then, the attribute information of the file to be encrypted is obfuscated to prevent external software from reading it
  • the flag bit may be confused, or characters may be added to remove the original.
  • the original file type flag, and subsequent decryption, the original file type can be parsed.
  • the file type of the file to be encrypted can be set to its own dedicated type (ie, the encryption type is set) to indicate that the file to be encrypted is encrypted by the set encryption rule.
  • the own special type can be directly HardCode to the local, or can be issued by the server for easy expansion.
  • the own dedicated type will add its own type suffix to the file type suffix of the file to be encrypted. If the encryption method is upgraded, the suffix name can be changed, and the server can issue different suffix names and encryption methods for upgrading. Correspondence.
  • Step S206 Generate an encrypted file according to the encrypted data content and the modified file type.
  • the data file in the encrypted file TEST may be first encrypted by the DES encryption algorithm; then, the flag bit corresponding to the original file type of the encrypted file TEST is performed.
  • the obfuscation operation assumes that a 12qi5 character string is generated; then, an encrypted file "TEST.12qi5.xyz" file can be generated according to the above operation and the data content is encrypted.
  • Step S208 Hide the generated encrypted file under the set hidden folder.
  • the setting of the hidden folder can be appropriately set by those skilled in the art according to actual needs, and this embodiment of the present application does not limit this.
  • the folder where the encrypted file is located is set as a hidden folder.
  • the encrypted file may also be hidden to a certain hidden folder.
  • the basic hiding and categorization of encrypted files is achieved.
  • steps S210 may be performed:
  • Step S210 Perform slice processing on the hidden encrypted file to generate multiple encrypted file slices; save the multiple encrypted file slices out of order.
  • storing multiple encrypted file slices out of order may include: obtaining an out of order rule for storing files out of order, and using the out of order rule to save out of order multiple encrypted file slices.
  • the out-of-order rules can be appropriately set by a person skilled in the art according to actual needs, and can be stored locally or on a server, and downloaded from the server when needed.
  • Step S212 Record the encrypted information, save the encrypted information to the server, or save it to a folder different from the folder where the encrypted file is located.
  • the encryption information includes: information for setting encryption rules, information for slice processing, and information stored out of order.
  • a file may be stored, and corresponding to the file, different files may have different combinations of operations.
  • decrypting it will first query the file's encryption combination mode, and then generate a decryption combination for decryption.
  • the decryption "key” is stored in a different place from the folder where the encrypted file is located, which prevents the information leakage that could be caused by placing the encryption and decryption information in one place.
  • the user can effectively encrypt any file, and only save (if any) the key (encryption method, slicing rules, out-of-order rules, etc.) on the server, and do not save the encrypted file.
  • People can decrypt files. To decrypt, you must first get the "key”. When you get the "key”, a person skilled in the art can also set a variety of appropriate verification conditions to ensure that it can only be obtained legally.
  • the trace of the file to be encrypted is first removed in the system, and then the data content is encrypted, and then the file type, slice, and out-of-order storage are re-encrypted to encrypt the encrypted file, and then the encrypted file is encrypted.
  • the keys are stored elsewhere to achieve limited reversible file access control. Effectively guarantee the security of user privacy data of smart devices and prevent the leakage of user privacy data.
  • the file encryption method in this embodiment may be executed by any appropriate device having data processing capabilities, including, but not limited to, various terminal devices or servers, such as a PC, a tablet computer, a mobile terminal, and the like.
  • various terminal devices or servers such as a PC, a tablet computer, a mobile terminal, and the like.
  • the solution in the embodiment of the present application is applicable to a privacy encryption scenario of a local file of any device.
  • Example three
  • the file encryption device of this embodiment includes: a determining module 302 configured to determine that a file to be encrypted is not stored in a system folder, wherein the file to be encrypted stores user privacy data; and an encryption module 304 is configured to follow a set encryption rule The data content of the file to be encrypted is encrypted, and the file type of the file to be encrypted is set to the set encryption type after the encryption process, where the set encryption type and Corresponding to the set encryption rule, the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule; the generating module 306 is configured to generate an encrypted file according to the encrypted data content and the modified file type.
  • the file encryption device of this embodiment is configured to implement the corresponding file encryption methods in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
  • the file encryption device of this embodiment includes: a determination module 402 configured to determine that a file to be encrypted is not stored in a system folder, wherein the file to be encrypted stores user privacy data; and an encryption module 404 is configured to follow a set encryption rule The data content of the file to be encrypted is encrypted, and the file type of the file to be encrypted is set to the set encryption type after the encryption process, where the set encryption type corresponds to the set encryption rule, and the set encryption type is used for Indicates that the file to be encrypted is encrypted by a set encryption rule; a generating module 406 is configured to generate an encrypted file according to the encrypted data content and the modified file type.
  • the encryption module 404 includes: an obtaining module 4042 configured to obtain a set encryption rule, wherein the set encryption rule includes information of an encryption algorithm and information of an encryption type; the content processing module 4044 is configured to according to the information of the encryption algorithm The indicated encryption algorithm performs encryption processing on the data content of the file to be encrypted; the type processing module 4046 is configured to set the file type of the file to be encrypted to the encryption type indicated by the information of the encryption type.
  • the type processing module 4046 is configured to perform type elimination processing on the file attribute information of the file to be encrypted, where the type elimination processing is used to remove the original file type information of the file to be encrypted; after the type elimination processing is performed, the to be encrypted The file type of the file is set to set the encryption type.
  • the type removal processing includes: obfuscating the original file type information identifying the file to be encrypted in the file attribute information, or performing set character processing on the original file type information identifying the file to be encrypted in the file attribute information.
  • the file encryption device of this embodiment further includes: a hiding module 408, configured to hide the generated encrypted file under a set hidden folder.
  • the file encryption device of this embodiment further includes: a slicing module 410 configured to perform slicing processing on the encrypted file after the hidden processing, after the hidden module 408 hides the generated encrypted file under a set hidden folder, Generate multiple encrypted file slices; an out-of-order module 412 is configured to save the multiple encrypted file slices out of order.
  • the out-of-order module 412 is configured to obtain out-of-order rules for out-of-order storage files, and use the out-of-order rules to perform out-of-order storage on multiple encrypted file slices.
  • the file encryption device in this embodiment further includes: a recording module 414 configured to record encryption information, where the encryption information includes: information for setting encryption rules, information for slice processing, and information stored out of order; Save the encrypted information to the server, or save it to a folder different from the folder where the encrypted file is located.
  • a recording module 414 configured to record encryption information, where the encryption information includes: information for setting encryption rules, information for slice processing, and information stored out of order; Save the encrypted information to the server, or save it to a folder different from the folder where the encrypted file is located.
  • the determination module 402 is configured to check whether a file to be encrypted is stored in the system folder; if it is, the file to be encrypted is removed from the system folder; if not, the encryption module 404 is executed.
  • the file encryption device in this embodiment is used to implement the corresponding file encryption methods in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
  • Example 5
  • FIG. 5 a schematic structural diagram of a device / terminal / server according to Embodiment 5 of the present application is shown.
  • the specific embodiment of the present application does not limit the specific implementation of the device / terminal / server.
  • the device / terminal / server may include a processor 502 and a storage device 504.
  • the processor 502 is configured to execute a program 506, and may specifically perform related steps in the foregoing embodiment of the file encryption method.
  • the program 506 may include program code, where the program code includes a computer operation instruction.
  • the processor 502 may be a central processing unit CPU, or an integrated circuit (ASICC Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
  • One or more processors included in the device / terminal / server which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs .
  • the storage device 504 is configured to store one or more programs 506.
  • the storage device 504 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
  • the program 506 may be specifically configured to cause the processor 502 to perform the following operations: It is determined that the file to be encrypted is not stored in the system folder, where the user privacy data is stored in the file to be encrypted; and the data content of the file to be encrypted is set according to the set encryption rule. Perform encryption processing, and set the file type of the file to be encrypted to the set encryption type after the encryption processing, where setting the encryption type is opposite to setting the encryption rule.
  • the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule; and an encrypted file is generated according to the data content of the encryption process and the modified file type.
  • the program 506 is further configured to cause the processor 502 to perform encryption processing on the data content of the file to be encrypted in accordance with the set encryption rule, and set the file type of the file to be encrypted after the encryption processing to
  • a set encryption rule is obtained, where the set encryption rule includes information of the encryption algorithm and information of the encryption type; the encryption algorithm indicates the data content of the encrypted file according to the encryption algorithm indicated by the encryption algorithm information; The file type of the file to be encrypted is set to the encryption type indicated by the encryption type information.
  • the program 506 is further configured to cause the processor 502 to perform detype processing on the file attribute information of the file to be encrypted when the file type of the file to be encrypted is set to the set encryption type, where The type processing is used to remove the original file type information of the file to be encrypted; after the detype processing is performed, the file type of the file to be encrypted is set to a set encryption type.
  • the detype processing includes: obfuscating the original file type information identifying the file to be encrypted in the file attribute information, or performing the original file type information identifying the file to be encrypted in the file attribute information. Add set character processing.
  • the program 506 is further configured to cause the processor 502 to hide the generated encrypted file under a set hidden folder.
  • the program 506 is further configured to cause the processor 502 to perform slice processing on the hidden encrypted file after the generated encrypted file is hidden under the set hidden folder to generate multiple encryptions. File slicing; Save multiple encrypted file slices out of order.
  • the program 506 is further configured to cause the processor 502 to obtain out-of-order rules for out-of-order storage files when storing a plurality of encrypted file slices out-of-order, and use out-of-order rules for multiple Encrypted file slices are stored out of order.
  • the program 506 is further configured to cause the processor 502 to record encryption information, where the encryption information includes: information for setting encryption rules, information for slicing processing, and information stored out of order; encryption Save the information to the server, or save it to a folder different from the folder where the encrypted file is located.
  • the program 506 is further configured to cause the processor 502 to check whether a file to be encrypted is stored in the system folder when it is determined that the file to be encrypted is not stored in the system folder; if it is, it is to be encrypted The file is removed from the system folder; if not, the data content of the file to be encrypted is encrypted according to the set encryption rule, and the operation of setting the file type of the file to be encrypted to the set encryption type is performed after the encryption process. .
  • each step in the program 506 reference may be made to corresponding descriptions in corresponding steps and units in the foregoing embodiment of the file encryption method, and details are not described herein. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the devices and modules described above may refer to the corresponding process descriptions in the foregoing method embodiments, and are not repeated here.
  • a file to be encrypted is not stored in the system folder to avoid leakage of the file to be encrypted that stores user privacy data through the system folder; then, according to the set encryption rule, The data content of the encrypted file is encrypted and its file type is set to the set encryption type.
  • the set encryption type is different from the conventional file type and corresponds to the set encryption rule. It is used to indicate that the current file has passed the set encryption rule. Encryption.
  • the encrypted file is difficult to be identified and read by general programs, which improves the density.
  • the encryption rules can be clearly marked to provide information for subsequent decryption.
  • the data content and the modified file type generate corresponding encrypted files.
  • each component / step described in the embodiment of the present application may be split into more components / steps, or two or more components / steps or partial operations of components / steps may be combined into New components / steps to achieve the purpose of the embodiments of the present application.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • the embodiment of the present application includes a computer program product including a computer program borne on a computer-readable medium, where the computer program includes program code for executing the methods shown in the foregoing multiple method embodiments.
  • the computer program may be downloaded and installed from a network through a communication section, and / or installed from a removable medium.
  • CPU central processing unit
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the foregoing.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access storage (RAM), read-only storage (ROM), erasable Type programmable read-only storage device (EPROM or flash memory), optical fiber, portable compact disk read-only storage device (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be instructed to execute a system or device Either the device is used or used in combination.
  • a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, which includes an object-oriented programming language--such as
  • Java, Smalltalk, C ++ also includes regular procedural programming languages such as "C” or similar programming languages.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer, partly on a remote computer, or entirely on a remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as provided by an Internet service) (Commercially connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • an Internet service Commercially connected via the Internet
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions for implementing a specified logical function Executable instructions.
  • the functions marked in the boxes may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented in a dedicated hardware-based system that performs the specified function or operation. Or, it can be implemented by a combination of dedicated hardware and computer instructions.
  • the units described in the embodiments of the present application may be implemented in a software manner, or may be implemented in a hardware manner.
  • the described unit may also be provided in a processor, for example, it may be described as:
  • a processor includes a determination unit, an encryption unit, and a generation unit.
  • the names of these units do not constitute a limitation on the unit itself in some cases, for example, the determining unit may also be described as "a unit that determines that a file to be encrypted is not saved in a system folder".
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the foregoing embodiments is implemented.
  • the present application further provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device is caused to determine that a file to be encrypted is not saved in a system folder, where a file to be encrypted is stored User privacy data; according to the set encryption rule, the data content of the file to be encrypted is encrypted, and the file type of the file to be encrypted is set to the set encryption type after the encryption process, wherein the set encryption type and the set encryption rule Correspondingly, the set encryption type is used to indicate that the file to be encrypted is encrypted by the set encryption rule; and an encrypted file is generated according to the data content of the encryption process and the modified file type.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

本申请实施例提供了一种文件加密方法、装置、设备/终端/服务器及计算机可读存储介质,其中,文件加密方法包括:确定待加密文件未保存于系统文件夹下,其中,所述待加密文件中存储有用户隐私数据;按照设定加密规则,对所述待加密文件的数据内容进行加密处理,并在所述加密处理后将所述待加密文件的文件类型设置为设定加密类型,其中,所述设定加密类型与所述设定加密规则相对应,所述设定加密类型用于指示所述待加密文件经过所述设定加密规则加密;根据加密处理后的所述数据内容和修改后的所述文件类型,生成加密文件。通过本申请实施例,可以有效保证智能设备的用户隐私数据的安全,防范用户隐私数据泄露。

Description

文件加密方法、 装置、 设备 /终端 /服务器及计算机可读存储介质 申请要求在 2018年 08月 27日提交中国专利局、申请号为 201810978593.7、 发明名称为“文件加密方法、装置、设备 /终端 /服务器及计算机可读存储介质” 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本申请实施例涉及数据处理技术领域,尤其涉及一种文件加密方法、装置、 设备 /终端 /服务器及计算机可读存储介质。 背景技术
目前, 智能设备在日常生活中越来越普及, 随着智能设备的普及, 随之而 来的数据安全问题已经引起人们越来越广泛的关注。
智能设备中保存有大量的用户隐私数据,如,用户的身份数据、行为数据、 医疗数据, 或者用户想要保护的其它数据等, 而智能设备面临的数据安全问题 也多种多样, 例如, 有来自网络的黑客攻击、 病毒入侵等等带来的数据安全威 胁; 也有来自智能设备管理上的漏洞和使用权限控制的强度不够造成的数据安 全问题; 还有高机密数据的存储设备的管理所带来的安全隐患。
因此, 如何保护智能设备的用户隐私数据的安全、 防范泄露, 成为亟待解 决的问题。 发明内容
有鉴于此, 本申请实施例所解决的技术问题之一在于提供一种文件加密方 法、 装置、 设备 /终端 /服务器及计算机可读存储介质, 用以保证用户隐私数据 的安全。
根据本申请实施例的第一方面, 提供了一种文件加密方法, 包括: 确定待 加密文件未保存于系统文件夹下, 其中, 所述待加密文件中存储有用户隐私数 据; 按照设定加密规则, 对所述待加密文件的数据内容进行加密处理, 并在所 述加密处理后将所述待加密文件的文件类型设置为设定加密类型, 其中, 所述 设定加密类型与所述设定加密规则相对应, 所述设定加密类型用于指示所述待 加密文件经过所述设定加密规则加密; 根据加密处理后的所述数据内容和修改 后的所述文件类型, 生成加密文件。
根据本申请实施例的第二方面, 还提供了一种文件加密装置, 包括: 确定 模块, 配置为确定待加密文件未保存于系统文件夹下, 其中, 所述待加密文件 中存储有用户隐私数据; 加密模块, 配置为按照设定加密规则, 对所述待加密 文件的数据内容进行加密处理, 并在所述加密处理后将所述待加密文件的文件 类型设置为设定加密类型, 其中, 所述设定加密类型与所述设定加密规则相对 应, 所述设定加密类型用于指示所述待加密文件经过所述设定加密规则加密; 生成模块, 配置为根据加密处理后的所述数据内容和修改后的所述文件类型, 生成加密文件。
根据本申请实施例的第三方面, 还提供了一种设备 /终端 /服务器, 包括: 一个或多个处理器; 存储装置, 配置为存储一个或多个程序; 当所述一个或多 个程序被所述一个或多个处理器执行, 使得所述一个或多个处理器实现如第一 方面所述的文件加密方法。
根据本申请实施例的第四方面, 还提供了一种计算机可读存储介质, 其上 存储有计算机程序, 该程序被处理器执行时实现如第一方面所述的文件加 密方法。
通过本申请实施例提供的文件加密方案, 首先确定在系统文件夹下未保存 待加密文件, 以避免保存有用户隐私数据的待加密文件通过系统文件夹泄漏; 然后, 按照设定加密规则, 对待加密文件的数据内容进行加密并将其文件类型 设置为设定加密类型, 该设定加密类型不同于常规的文件类型, 其与设定加密 规则对应, 用于指示当前文件已通过设定加密规则加密, 由此, 一方面, 加密 后的文件很难被一般程序识别和读取, 提升了保密度, 另一方面, 也可清楚标 记加密规则, 以为后续解密提供信息; 最后, 根据加密处理后的数据内容和修 改后的文件类型, 生成相应的加密文件。 可见, 通过本申请实施例提供的文件 加密方案, 可以有效保证智能设备的用户隐私数据的安全, 防范用户隐私数据 泄露。 附图说明
后文将参照附图以示例性而非限制性的方式详细描述本申请实施例的一些 具体实施例。 附图中相同的附图标记标示了相同或类似的部件或部分。 本领域 技术人员应该理解, 这些附图未必是按比例绘制的。 附图中: 图 i是根据本申请实施例一的一种文件加密方法的步骤流程图; 图 2是根据本申请实施例二的一种文件加密方法的步骤流程图;
图 3是根据本申请实施例三的一种文件加密装置的结构框图;
图 4是根据本申请实施例四的一种文件加密装置的结构框图;
图 5是根据本申请实施例五的一种设备 /终端 /服务器的结构示意图。 具体实施方式
为了使本领域的人员更好地理解本申请实施例中的技术方案, 下面将结合 本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述, 显然,所描述的实施例仅是本申请实施例一部分实施例,而不是全部的实施例。 基于本申请实施例中的实施例,本领域普通技术人员所获得的所有其他实施例, 都应当属于本申请实施例保护的范围。 实施例一
参照图 1,示出了根据本申请实施例一的一种文件加密方法的步骤流程图。 本实施例的文件加密方法包括以下步骤:
步骤 S102: 确定待加密文件未保存于系统文件夹下。
其中, 待加密文件中存储有用户隐私数据。 用户隐私数据包括但不限于用 户的身份数据、 行为数据、 医疗数据, 或者用户想要保护的其它数据等。
对于不同的操作系统, 均设置有不同的系统文件夹, 以保存相关文件, 例 如, Android 系统的系统媒体库等, 其中包含了用户设备内所有特定媒体文件 的相关属性等。
步骤 S104: 按照设定加密规则, 对待加密文件的数据内容进行加密处理, 并在加密处理后将待加密文件的文件类型设置为设定加密类型。
其中, 设定加密类型与设定加密规则相对应, 设定加密类型用于指示待加 密文件经过设定加密规则加密。不同的设定加密规则对应不同的设定加密类型, 该设定加密类型不同于常规的文件类型, 可以由本领域技术人员根据需要自定 义任意适当的字符串表征该加密类型。
设定加密规则可以从服务器中下载使用, 也可以下载到本地后加载使用。 将设定加密规则与设定加密类型相对应, 一方面, 通过加密类型可反映加密规 则, 在后续解密时可直接获取或使用与加密类型对应的加密规则的信息, 以对 加密文件的快速、 准确解密提供依据; 另一方面, 若在服务器端更新了加密规 则, 则相应地也更新加密类型, 客户端检测到有新的加密类型产生, 即可确定 加密规则进行了更新, 从而重新从服务器端下载新的加密规则使用, 提高了加 密效率和安全度。
步骤 S106: 根据加密处理后的数据内容和修改后的文件类型, 生成加密文 件。
在对待加密文件的数据内容进行加密处理, 并且修改了待加密文件的文件 类型后, 即可生成最终的加密文件。
通过本实施例提供的文件加密方案, 首先确定在系统文件夹下未保存待加 密文件,以避免保存有用户隐私数据的待加密文件通过系统文件夹泄漏;然后, 按照设定加密规则, 对待加密文件的数据内容进行加密并将其文件类型设置为 设定加密类型, 该设定加密类型不同于常规的文件类型, 其与设定加密规则对 应, 用于指示当前文件已通过设定加密规则加密, 由此, 一方面, 加密后的文 件很难被一般程序识别和读取, 提升了保密度, 另一方面, 也可清楚标记加密 规则, 以为后续解密提供信息; 最后, 根据加密处理后的数据内容和修改后的 文件类型, 生成相应的加密文件。 可见, 通过本实施例提供的文件加密方案, 可以有效保证智能设备的用户隐私数据的安全, 防范用户隐私数据泄露。
本实施例的文件加密方法可以由任意适当的具有数据处理能力的设备执行, 包括但不限于:各种终端设备或者服务器,如, PC机、平板电脑、移动终端等。 实施例二
参照图 2,示出了根据本申请实施例二的一种文件加密方法的步骤流程图。 本实施例的文件加密方法包括以下步骤:
步骤 S202: 检查系统文件夹下是否保存有待加密文件; 若是, 则将待加密 文件从系统文件夹下移除, 然后执行步骤 S204; 若否, 则直接执行步骤 S204。
其中, 待加密文件中存储有用户隐私数据。
例如, 将待加密文件从系统媒体库移除(如果有),如果系统媒体库中不存 在该待加密文件, 则可忽略本步骤。 由此, 首先确保待加密文件不在系统媒体 库中, 将其加密后, 就不会在系统媒体库中再出现, 可避免用户隐私数据通过 系统媒体库泄漏。
通过本步骤, 可以确定待加密文件是否保存于系统文件夹下, 并在有保存 时将其移除, 在无保存时执行后续步骤, 从而实现对待加密文件未保存于系统 文件夹下的确定。 .步骤 S204:按照设定加密规则,对待加密文件的数据内容进行加密处理, 并在加密处理后将待加密文件的文件类型设置为设定加密类型。
其中, 设定加密类型与设定加密规则相对应, 设定加密类型用于指示待加 密文件经过设定加密规则加密。
在一种可行方式中, 本步骤可以实现为: 获取设定加密规则, 其中, 设定 加密规则包括加密算法的信息和加密类型的信息; 根据加密算法的信息指示的 加密算法, 对待加密文件的数据内容进行加密处理; 然后, 将待加密文件的文 件类型设置为加密类型的信息指示的加密类型。
待加密文件的数据内容表示待加密文件的实际内容, 包括但不限于记录在 待加密文件中的用户隐私数据等。 加密算法和加密类型可以由本领域技术人员 根据实际需要适当设定, 本申请实施例对此不作限制, 如, 加密算法可以是任 意适当的对称加密算法、 非对称加密算法、 HASH加密算法, 等等。
在一种可行方式中, 将待加密文件的文件类型设置为设定加密类型可以包 括: 对待加密文件的文件属性信息进行去类型处理, 其中, 去类型处理用于去 除待加密文件的原始文件类型信息; 在进行去类型处理后, 将待加密文件的文 件类型设置为设定加密类型。 通过去类型处理, 在加密时可隐藏待加密文件的 原始文件类型, 不易被识别和读取, 提高加密程度; 而在解密时, 又可以快速 解析恢复其原始文件类型, 提高解密操作效率。 其中, 去类型处理包括: 对待 加密文件的文件属性信息中标识待加密文件的原始文件类型信息进行混淆操作, 或者, 对待加密文件的文件属性信息中标识待加密文件的原始文件类型信息进 行添加设定字符处理。 其中, 所述设定字符可以由本领域技术人员根据实际需 要适当设置, 包括但不限于: 字符、 数字、 符号等, 本申请实施例对此不作限 制。
混淆操作是一种信息保护技术, 其可以将表意的字符组合如名称替换为无 意义的字符组合。 本申请实施例中, 通过对原始文件类型信息进行混淆操作进 行混淆操作,一方面,可以去除待加密文件的原始文件类型的信息,另一方面, 也在一定程度上起到了数据保护作用。 而通过添加设定字符处理的方式, 则简 单易实现, 既达到了保密目的, 又降低了实现成本。
例如, 在确定系统媒体库中不存在待加密文件后, 对待加密文件中的数据 内容进行加密, 例如本地加密或者服务器加密等; 然后, 对待加密文件的属性 信息进行混淆操作, 防止外部软件读取, 如, 待加密文件中有一个标志该待加 密文件的文件类型的标志位, 可以对该标志位进行混淆, 或者添加字符去除原 始的文件类型标志, 后续在解密时, 可以再解析出原始的文件类型。 通过该过 程, 可以将待加密文件的文件类型设置为自有专用类型 (即设定加密类型) , 以表示该待加密文件被所述设定加密规则加密。自有专用类型可直接 HardCode 到本地, 也可以由服务器下发, 便于拓展。 具体地, 该自有专用类型会在待加 密文件的文件类型后缀上面添加自有的类型后缀, 如果加密方式升级, 则可以 改变这个后缀名,从服务器可以下发不同的后缀名和加密方式升级的对应关系。
步骤 S206: 根据加密处理后的数据内容和修改后的文件类型, 生成加密文 件。
例如, 当前设定加密规则指示使用 DES加密算法和 xyz加密类型, 则可以 先对待加密文件 TEST中的数据文件进行 DES加密算法进行加密; 然后, 对待 加密文件 TEST的原始文件类型对应的标志位进行混淆操作, 假设生成 12qi5 字符串; 则, 根据上述操作可生成加密文件“TEST.12qi5.xyz”文件且其中数 据内容被加密。
至此, 实现了对待加密文件的加密和隐私数据保护, 进一步地, 为了进一 步提升加密效果, 还可以执行以下可选步骤。
步骤 S208: 将生成的加密文件隐藏至设定隐藏文件夹下。
其中, 设定隐藏文件夹可以由本领域技术人员根据实际需要适当设置, 本 申请实施例对此不作限制。
例如, 将加密文件所在的文件夹设置为隐藏文件夹, 可选地, 还可以隐藏 加密文件到设定的某隐藏文件夹下。 由此, 实现了对加密文件的基本的隐藏和 归类处理。
进一步可选地, 还可以执行以下步骤 S210, 匡口:
步骤 S210: 对隐藏处理后的加密文件进行切片处理, 生成多个加密文件切 片; 将多个加密文件切片进行乱序保存。
例如, 设定一个 size, 然后根据该 size对加密文件进行切片处理, 每满足 该 size后就会切片, 当然, 最后一片可能会少于该 size。
其中, 在一种可行方式中, 将多个加密文件切片进行乱序保存可以包括: 获取用于乱序存储文件的乱序规则, 使用该乱序规则对多个加密文件切片进行 乱序保存。 所述乱序规则可以由本领域技术人员根据实际需求适当设置, 可以 保存在本地, 也可以保存在服务器, 在需要时从服务器端下载。
通过将加密文件进行进一步的切片和乱序保存, 实现了对待加密文件的强 加密。 可选地, 还可以执行下述步骤 S212, gp :
步骤 S212: 记录加密信息, 将加密信息保存至服务器, 或者, 保存至与加 密文件所在文件夹不同的文件夹下。
其中, 所述加密信息包括: 设定加密规则的信息、 切片处理的信息、 和乱 序保存的信息。
记录设定加密规则的信息, 可以在后续对使用该设定加密规则的加密文件 进行解密处理; 记录切片处理的信息, 可以在后续确定切片数量并据此恢复文 件; 记录乱序保存的信息, 可以在后续对多个切片进行正确顺序的排列, 以恢 复文件。
例如,可以将对一个文件加密、切片等等使用的算法、规则都将存储起来, 并且和该文件对应起来, 不同的文件可能拥有不同的操作的组合。 解密时, 会 先去查询该文件的加密组合模式, 然后生成解密组合, 进行解密。
同时, 解密的“钥匙”保存在与加密文件所在文件夹不同的另外地方, 杜 绝了加解密信息放在一个地方可能导致的信息泄漏。 用户可以将任意文件进行 有效加密, 且在服务端只保存 (如果有) 密钥 (对该文件的加密方式、 切片规 则、 乱序规则等等) , 不保存加密文件, 除了用户以外, 没有任何人可以解密 文件。 需要解密必须先拿到“钥匙”, 在拿到“钥匙”时还可以由本领域技术人员 设置多种适当的验证条件, 以保证只能合法的获取。
通过本实施例, 首先移除待加密文件在系统内痕迹, 然后先通过对数据内 容加密, 接收再修改文件类型、 切片、 乱序保存等再加密的方式, 对待加密文 件进行加密, 然后将密钥保存到其他地方来实现有限的可逆文件访问控制。 有 效保证了智能设备的用户隐私数据的安全, 防范了用户隐私数据泄露。
本实施例的文件加密方法可以由任意适当的具有数据处理能力的设备执行, 包括但不限于:各种终端设备或者服务器,如, PC机、平板电脑、移动终端等。 本申请实施例的方案适用于任何设备的本地文件的隐私加密场景。 实施例三
参照图 3 , 示出了根据本申请实施例三的一种文件加密装置的结构框图。 本实施例的文件加密装置包括: 确定模块 302, 配置为确定待加密文件未 保存于系统文件夹下,其中,待加密文件中存储有用户隐私数据;加密模块 304, 配置为按照设定加密规则, 对待加密文件的数据内容进行加密处理, 并在加密 处理后将待加密文件的文件类型设置为设定加密类型, 其中, 设定加密类型与 设定加密规则相对应, 设定加密类型用于指示待加密文件经过设定加密规则加 密; 生成模块 306, 配置为根据加密处理后的数据内容和修改后的文件类型, 生成加密文件。
本实施例的文件加密装置用于实现前述多个方法实施例中相应的文件加密 方法, 并具有相应的方法实施例的有益效果, 在此不再赘述。 实施例四
参照图 4, 示出了根据本申请实施例四的一种文件加密装置的结构框图。 本实施例的文件加密装置包括: 确定模块 402, 配置为确定待加密文件未 保存于系统文件夹下,其中,待加密文件中存储有用户隐私数据;加密模块 404, 配置为按照设定加密规则, 对待加密文件的数据内容进行加密处理, 并在加密 处理后将待加密文件的文件类型设置为设定加密类型, 其中, 设定加密类型与 设定加密规则相对应, 设定加密类型用于指示待加密文件经过设定加密规则加 密; 生成模块 406, 配置为根据加密处理后的数据内容和修改后的文件类型, 生成加密文件。
可选地, 加密模块 404包括: 获取模块 4042, 配置为获取设定加密规则, 其中, 设定加密规则包括加密算法的信息和加密类型的信息; 内容处理模块 4044, 配置为根据加密算法的信息指示的加密算法, 对待加密文件的数据内容 进行加密处理; 类型处理模块 4046, 配置为将待加密文件的文件类型设置为加 密类型的信息指示的加密类型。
可选地, 类型处理模块 4046, 配置为对待加密文件的文件属性信息进行去 类型处理, 其中, 去类型处理用于去除待加密文件的原始文件类型信息; 在进 行去类型处理后, 将待加密文件的文件类型设置为设定加密类型。
可选地, 去类型处理包括: 对文件属性信息中标识待加密文件的原始文件 类型信息进行混淆操作, 或者, 对文件属性信息中标识待加密文件的原始文件 类型信息进行添加设定字符处理。
可选地, 本实施例文件加密装置还包括: 隐藏模块 408, 配置为将生成的 加密文件隐藏至设定隐藏文件夹下。
可选地, 本实施例的文件加密装置还包括: 切片模块 410, 配置为在隐藏 模块 408将生成的加密文件隐藏至设定隐藏文件夹下之后, 对隐藏处理后的加 密文件进行切片处理, 生成多个加密文件切片; 乱序模块 412, 配置为将多个 加密文件切片进行乱序保存。 可选地, 乱序模块 412, 配置为获取用于乱序存储文件的乱序规则, 使用 乱序规则对多个加密文件切片进行乱序保存。
可选地, 本实施例的文件加密装置还包括: 记录模块 414, 配置为记录加 密信息, 其中, 加密信息包括: 设定加密规则的信息、 切片处理的信息、 和乱 序保存的信息; 将加密信息保存至服务器, 或者, 保存至与加密文件所在文件 夹不同的文件夹下。
可选地,确定模块 402,配置为检查系统文件夹下是否保存有待加密文件; 若是,则将待加密文件从系统文件夹下移除;若否,则进入加密模块 404执行。
本实施例的文件加密装置用于实现前述多个方法实施例中相应的文件加密 方法, 并具有相应方法实施例的有益效果, 在此不再赘述。 实施例五
参照图 5 , 示出了根据本申请实施例五的一种设备 /终端 /服务器的结构示 意图, 本申请具体实施例并不对设备 /终端 /服务器的具体实现做限定。
如图 5所示, 该设备 /终端 /服务器可以包括: 处理器 (processor)502、 存储 装置 504。
其中:
处理器 502,用于执行程序 506,具体可以执行上述文件加密方法实施例中 的相关步骤。
具体地, 程序 506可以包括程序代码, 该程序代码包括计算机操作指令。 处理器 502可能是中央处理器 CPU,或者是特定集成电路 ASICC Application Specific Integrated Circuit) , 或者是被配置成实施本申请实施例的一个或多个 集成电路。 设备 /终端 /服务器包括的一个或多个处理器, 可以是同一类型的处 理器, 如一个或多个 CPU; 也可以是不同类型的处理器, 如一个或多个 CPU 以及一个或多个 ASIC。
存储装置 504,配置为存放一个或多个程序 506。存储装置 504可能包含高 速 RAM存储器, 也可能还包括非易失性存储器 (non-volatile memory) , 例如 至少一个磁盘存储器。
程序 506具体可以用于使得处理器 502执行以下操作: 确定待加密文件未 保存于系统文件夹下, 其中, 待加密文件中存储有用户隐私数据; 按照设定加 密规则, 对待加密文件的数据内容进行加密处理, 并在加密处理后将待加密文 件的文件类型设置为设定加密类型, 其中, 设定加密类型与设定加密规则相对 应, 设定加密类型用于指示待加密文件经过所述设定加密规则加密; 根据加密 处理后的数据内容和修改后的文件类型, 生成加密文件。
在一种可选的实施方式中, 程序 506还用于使得处理器 502在按照设定加 密规则, 对待加密文件的数据内容进行加密处理, 并在加密处理后将待加密文 件的文件类型设置为设定加密类型时, 获取设定加密规则, 其中, 设定加密规 则包括加密算法的信息和加密类型的信息; 根据加密算法的信息指示的加密算 法, 对待加密文件的数据内容进行加密处理; 将待加密文件的文件类型设置为 加密类型的信息指示的加密类型。
在一种可选的实施方式中, 程序 506还用于使得处理器 502在将待加密文 件的文件类型设置为设定加密类型时, 对待加密文件的文件属性信息进行去类 型处理, 其中, 去类型处理用于去除待加密文件的原始文件类型信息; 在进行 去类型处理后, 将待加密文件的文件类型设置为设定加密类型。
在一种可选的实施方式中, 去类型处理包括: 对文件属性信息中标识待加 密文件的原始文件类型信息进行混淆操作, 或者, 对文件属性信息中标识待加 密文件的原始文件类型信息进行添加设定字符处理。
在一种可选的实施方式中, 程序 506还用于使得处理器 502将生成的加密 文件隐藏至设定隐藏文件夹下。
在一种可选的实施方式中, 程序 506还用于使得处理器 502在将生成的加 密文件隐藏至设定隐藏文件夹下之后,对隐藏处理后的加密文件进行切片处理, 生成多个加密文件切片; 将多个加密文件切片进行乱序保存。
在一种可选的实施方式中, 程序 506还用于使得处理器 502在将多个加密 文件切片进行乱序保存时, 获取用于乱序存储文件的乱序规则, 使用乱序规则 对多个加密文件切片进行乱序保存。
在一种可选的实施方式中,程序 506还用于使得处理器 502记录加密信息, 其中, 加密信息包括: 设定加密规则的信息、 切片处理的信息、 和乱序保存的 信息; 将加密信息保存至服务器, 或者, 保存至与加密文件所在文件夹不同的 文件夹下。
在一种可选的实施方式中, 程序 506还用于使得处理器 502在确定待加密 文件未保存于系统文件夹下时, 检查系统文件夹下是否保存有待加密文件; 若 是, 则将待加密文件从系统文件夹下移除; 若否, 则执行按照设定加密规则, 对待加密文件的数据内容进行加密处理, 并在加密处理后将待加密文件的文件 类型设置为设定加密类型的操作。 程序 506中各步骤的具体实现可以参见上述文件加密方法实施例中的相应 步骤和单元中对应的描述, 在此不赘述。 所属领域的技术人员可以清楚地了解 到, 为描述的方便和简洁, 上述描述的设备和模块的具体工作过程, 可以参考 前述方法实施例中的对应过程描述, 在此不再赘述。
通过本实施例的设备 /终端 /服务器, 首先确定在系统文件夹下未保存待加 密文件,以避免保存有用户隐私数据的待加密文件通过系统文件夹泄漏;然后, 按照设定加密规则, 对待加密文件的数据内容进行加密并将其文件类型设置为 设定加密类型, 该设定加密类型不同于常规的文件类型, 其与设定加密规则对 应, 用于指示当前文件已通过设定加密规则加密, 由此, 一方面, 加密后的文 件很难被一般程序识别和读取, 提升了保密度, 另一方面, 也可清楚标记加密 规则, 以为后续解密提供信息; 最后, 根据加密处理后的数据内容和修改后的 文件类型, 生成相应的加密文件。 可见, 通过本实施例提供的文件加密方案, 可以有效保证智能设备的用户隐私数据的安全, 防范用户隐私数据泄露。 需要指出, 根据实施的需要, 可将本申请实施例中描述的各个部件 /步骤拆 分为更多部件 /步骤, 也可将两个或多个部件 /步骤或者部件 /步骤的部分操作组 合成新的部件 /步骤, 以实现本申请实施例的目的。
特别地, 根据本申请实施例, 上文参考流程图描述的过程可以被实现为计 算机软件程序。 例如, 本申请实施例包括一种计算机程序产品, 其包括承载在 计算机可读介质上的计算机程序, 该计算机程序包含用于执行上文多个方法实 施例中所示的方法的程序代码。 在这样的实施例中, 该计算机程序可以通过通 信部分从网络上被下载和安装, 和 /或从可拆卸介质被安装。在该计算机程序被 中央处理单元 (CPU) 执行时, 执行本申请实施例示出的方法中限定的上述功 能。 需要说明的是, 本申请所述的计算机可读介质可以是计算机可读信号介质 或者计算机可读存储介质或者是上述两者的任意组合。 计算机可读存储介质例 如可以是, 但不限于, 电、 磁、 光、 电磁、 红外线、 或半导体的系统、 装置或 器件, 或者任意以上的组合。 计算机可读存储介质的更具体的例子可以包括但 不限于: 具有一个或多个导线的电连接、 便携式计算机磁盘、 硬盘、 随机访问 存储装置( RAM)、只读存储装置( ROM)、可擦式可编程只读存储装置( EPROM 或闪存)、光纤、便携式紧凑磁盘只读存储装置(CD-ROM)、光存储装置件、 磁存储装置件、 或者上述的任意合适的组合。 在本申请中, 计算机可读存储介 质可以是任何包含或存储程序的有形介质, 该程序可以被指令执行系统、 装置 或者器件使用或者与其结合使用。 而在本申请中, 计算机可读的信号介质可以 包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计算机可读的 程序代码。 这种传播的数据信号可以采用多种形式, 包括但不限于电磁信号、 光信号或上述的任意合适的组合。 计算机可读的信号介质还可以是计算机可读 存储介质以外的任何计算机可读介质, 该计算机可读介质可以发送、 传播或者 传输用于由指令执行系统、 装置或者器件使用或者与其结合使用的程序。 计算 机可读介质上包含的程序代码可以用任何适当的介质传输, 包括但不限于: 无 线、 电线、 光缆、 RF等等, 或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的 计算机程序代码, 所述程序设计语言包括面向对象的程序设计语言 ------诸如
Java、 Smalltalk, C++, 还包括常规的过程式程序设计语言 诸如” C”语言 或类似的程序设计语言。 程序代码可以完全地在用户计算机上执行、 部分地在 用户计算机上执行、 作为一个独立的软件包执行、 部分在用户计算机上部分在 远程计算机上执行、 或者完全在远程计算机或服务器上执行。 在涉及远程计算 机的情形中, 远程计算机可以通过任意种类的网络 ------包括局域网 (LAN)或广 域网 (WAN) 连接到用户计算机, 或者, 可以连接到外部计算机 (例如利用 因特网服务提供商来通过因特网连接) 。
附图中的流程图和框图, 图示了按照本申请各种实施例的系统、 方法和计 算机程序产品的可能实现的体系架构、 功能和操作。 在这点上, 流程图或框图 中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、 或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。 也应 当注意, 在有些作为替换的实现中, 方框中所标注的功能也可以以不同于附图 中所标注的顺序发生。 例如, 两个接连地表示的方框实际上可以基本并行地执 行, 它们有时也可以按相反的顺序执行, 这依所涉及的功能而定。 也要注意的 是, 框图和 /或流程图中的每个方框、 以及框图和 /或流程图中的方框的组合, 可以用执行规定的功能或操作的专用的基于硬件的系统来实现, 或者可以用专 用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现, 也可以 通过硬件的方式来实现。 所描述的单元也可以设置在处理器中, 例如, 可以描 述为: 一种处理器包括确定单元、 加密单元、 和生成单元。 其中, 这些单元的 名称在某种情况下并不构成对该单元本身的限定, 例如, 确定单元还可以被描 述为“确定待加密文件未保存于系统文件夹下的单元” 。 作为另一方面, 本申请还提供了一种计算机可读存储介质, 其上存储有计 算机程序, 该程序被处理器执行时实现如上述任一实施例所描述的方法。
作为另一方面, 本申请还提供了一种计算机可读介质, 该计算机可读介质 可以是上述实施例中描述的装置中所包含的; 也可以是单独存在, 而未装配入 该装置中。 上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多 个程序被该装置执行时,使得该装置:确定待加密文件未保存于系统文件夹下, 其中, 待加密文件中存储有用户隐私数据; 按照设定加密规则, 对待加密文件 的数据内容进行加密处理, 并在加密处理后将待加密文件的文件类型设置为设 定加密类型, 其中, 设定加密类型与设定加密规则相对应, 设定加密类型用于 指示待加密文件经过所述设定加密规则加密; 根据加密处理后的数据内容和修 改后的文件类型, 生成加密文件。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。 本领域 技术人员应当理解, 本申请中所涉及的发明范围, 并不限于上述技术特征的特 定组合而成的技术方案, 同时也应涵盖在不脱离上述发明构思的情况下, 由上 述技术特征或其等同特征进行任意组合而形成的其它技术方案。 例如上述特征 与本申请中公开的 (但不限于) 具有类似功能的技术特征进行互相替换而形成 的技术方案。

Claims

权 利 要 求 书
1. 一种文件加密方法, 包括:
确定待加密文件未保存于系统文件夹下, 其中, 所述待加密文件中存储有 用户隐私数据;
按照设定加密规则, 对所述待加密文件的数据内容进行加密处理, 并在所 述加密处理后将所述待加密文件的文件类型设置为设定加密类型, 其中, 所述 设定加密类型与所述设定加密规则相对应, 所述设定加密类型用于指示所述待 加密文件经过所述设定加密规则加密;
根据加密处理后的所述数据内容和修改后的所述文件类型,生成加密文件。
2. 根据权利要求 1所述的方法, 其中, 所述按照设定加密规则, 对所述待 加密文件的数据内容进行加密处理, 并在加密处理后将所述待加密文件的文件 类型设置为设定加密类型, 包括:
获取设定加密规则, 其中, 所述设定加密规则包括加密算法的信息和加密 类型的信息;
根据所述加密算法的信息指示的加密算法, 对所述待加密文件的数据内容 进行加密处理;
将所述待加密文件的文件类型设置为所述加密类型的信息指示的加密类型。
3. 根据权利要求 1或 2所述的方法, 其中, 所述将所述待加密文件的文件 类型设置为设定加密类型, 包括:
对所述待加密文件的文件属性信息进行去类型处理, 其中, 所述去类型处 理用于去除所述待加密文件的原始文件类型信息;
在进行所述去类型处理后, 将所述待加密文件的文件类型设置为所述设定 加密类型。
4. 根据权利要求 3所述的方法, 其中, 所述去类型处理包括: 对所述文件 属性信息中标识所述待加密文件的原始文件类型信息进行混淆操作, 或者, 对 所述文件属性信息中标识所述待加密文件的原始文件类型信息进行添加设定字 符处理。
5. 根据权利要求 1-4任一项所述的方法, 其中, 所述方法还包括: 将生成的所述加密文件隐藏至设定隐藏文件夹下。
6. 根据权利要求 5所述的方法, 其中, 在所述将生成的所述加密文件隐藏 至设定隐藏文件夹下之后, 所述方法还包括: 对隐藏处理后的所述加密文件进行切片处理, 生成多个加密文件切片; 将所述多个加密文件切片进行乱序保存。
7. 根据权利要求 6所述的方法, 其中, 所述将所述多个加密文件切片进行 乱序保存, 包括:
获取用于乱序存储文件的乱序规则, 使用所述乱序规则对所述多个加密文 件切片进行乱序保存。
8. 根据权利要求 5-7任一项所述的方法, 其中, 所述方法还包括: 记录加密信息, 其中, 所述加密信息包括: 所述设定加密规则的信息、 所 述切片处理的信息、 和所述乱序保存的信息;
将所述加密信息保存至服务器, 或者, 保存至与所述加密文件所在文件夹 不同的文件夹下。
9. 根据权利要求 1-8任一项所述的方法, 其中, 所述确定待加密文件未保 存于系统文件夹下, 包括:
检查系统文件夹下是否保存有所述待加密文件;
若是, 则将所述待加密文件从所述系统文件夹下移除; 若否, 则执行所述 按照设定加密规则, 对所述待加密文件的数据内容进行加密处理, 并在所述加 密处理后将所述待加密文件的文件类型设置为设定加密类型的步骤。
10. 一种文件加密装置, 包括:
确定模块, 配置为确定待加密文件未保存于系统文件夹下, 其中, 所述待 加密文件中存储有用户隐私数据;
加密模块, 配置为按照设定加密规则, 对所述待加密文件的数据内容进行 加密处理, 并在所述加密处理后将所述待加密文件的文件类型设置为设定加密 类型, 其中, 所述设定加密类型与所述设定加密规则相对应, 所述设定加密类 型用于指示所述待加密文件经过所述设定加密规则加密;
生成模块, 配置为根据加密处理后的所述数据内容和修改后的所述文件类 型, 生成加密文件。
11. 根据权利要求 10所述的装置, 其中, 所述加密模块包括:
获取模块, 配置为获取设定加密规则, 其中, 所述设定加密规则包括加密 算法的信息和加密类型的信息;
内容处理模块, 配置为根据所述加密算法的信息指示的加密算法, 对所述 待加密文件的数据内容进行加密处理; 类型处理模块, 配置为将所述待加密文件的文件类型设置为所述加密类型 的信息指示的加密类型。
12. 根据权利要求 10或 11所述的装置, 其中, 所述类型处理模块, 配置 为对所述待加密文件的文件属性信息进行去类型处理, 其中, 所述去类型处理 用于去除所述待加密文件的原始文件类型信息; 在进行所述去类型处理后, 将 所述待加密文件的文件类型设置为所述设定加密类型。
13. 根据权利要求 12所述的装置, 其中, 所述去类型处理包括: 对所述文 件属性信息中标识所述待加密文件的原始文件类型信息进行混淆操作, 或者, 对所述文件属性信息中标识所述待加密文件的原始文件类型信息进行添加设定 字符处理。
14. 根据权利要求 10-13任一项所述的装置, 其中, 所述装置还包括: 隐藏模块, 配置为将生成的所述加密文件隐藏至设定隐藏文件夹下。
15. 根据权利要求 14所述的装置, 其中, 所述装置还包括:
切片模块, 配置为在所述隐藏模块将生成的所述加密文件隐藏至设定隐藏 文件夹下之后, 对隐藏处理后的所述加密文件进行切片处理, 生成多个加密文 件切片;
乱序模块, 配置为将所述多个加密文件切片进行乱序保存。
16. 根据权利要求 15所述的装置, 其中, 所述乱序模块, 配置为获取用于 乱序存储文件的乱序规则, 使用所述乱序规则对所述多个加密文件切片进行乱 序保存。
17. 根据权利要求 14-16任一项所述的装置, 其中, 所述装置还包括: 记录模块, 配置为记录加密信息, 其中, 所述加密信息包括: 所述设定加 密规则的信息、 所述切片处理的信息、 和所述乱序保存的信息; 将所述加密信 息保存至服务器, 或者, 保存至与所述加密文件所在文件夹不同的文件夹下。
18. 根据权利要求 10-17任一项所述的装置, 其中, 所述确定模块, 配置 为检查系统文件夹下是否保存有所述待加密文件; 若是, 则将所述待加密文件 从所述系统文件夹下移除; 若否, 则进入所述加密模块执行。
19. 一种设备 /终端 /服务器, 包括:
一个或多个处理器;
存储装置, 配置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行, 使得所述一个或多 个处理器实现如权利要求 1-9中任一所述的方法。
20 ·—种计算机可读存储介质, 其上存储有计算机程序, 该程序被处理 器执行时实现如权利要求 1 -9中任一所述的方法。
PCT/IB2018/057162 2018-08-27 2018-09-18 文件加密方法、装置、设备/终端/服务器及计算机可读存储介质 Ceased WO2020044095A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810978593.7A CN109299611A (zh) 2018-08-27 2018-08-27 文件加密方法、装置、设备/终端/服务器及计算机可读存储介质
CN201810978593.7 2018-08-27

Publications (1)

Publication Number Publication Date
WO2020044095A1 true WO2020044095A1 (zh) 2020-03-05

Family

ID=65165476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IB2018/057162 Ceased WO2020044095A1 (zh) 2018-08-27 2018-09-18 文件加密方法、装置、设备/终端/服务器及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN109299611A (zh)
WO (1) WO2020044095A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120995505A (zh) * 2025-07-29 2025-11-21 河南金之汇信息技术有限公司 打印文件加密与备份方法、装置、电子设备

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781147A (zh) * 2019-11-04 2020-02-11 深圳传音控股股份有限公司 属性设置方法、装置及计算机可读存储介质
CN111031353B (zh) * 2019-12-11 2022-08-23 上海乐相科技有限公司 一种视频加密方法及装置
CN111259432B (zh) * 2020-02-18 2023-09-12 瑞芯微电子股份有限公司 一种模型数据保护方法和可读计算机存储介质
CN111767529A (zh) * 2020-05-18 2020-10-13 广州视源电子科技股份有限公司 文件加密方法、文件解密方法、存储介质和电子设备
CN111984941A (zh) * 2020-06-29 2020-11-24 深圳亿络科技有限公司 文件处理方法、装置、终端设备及可读存储介质
CN114722419B (zh) * 2021-01-04 2025-09-16 华为技术有限公司 设备级敏感文件保护方法、存储介质及电子设备
CN115408703A (zh) * 2021-05-27 2022-11-29 中移动信息技术有限公司 格式化文件处理方法、装置及存储介质
CN114329545A (zh) * 2021-12-27 2022-04-12 中国电信股份有限公司 数据的加密方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104134046A (zh) * 2014-07-29 2014-11-05 深圳市中兴移动通信有限公司 加密方法和装置
CN105022936A (zh) * 2014-04-30 2015-11-04 北京畅游天下网络技术有限公司 一种类class文件加密解密方法和装置
CN105100186A (zh) * 2015-04-27 2015-11-25 深圳市美贝壳科技有限公司 一种家庭云照片快速加密解密的方法
CN106250781A (zh) * 2016-07-31 2016-12-21 山东大学 一种基于虚拟机增量镜像的用户信息保护方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103198261A (zh) * 2012-01-09 2013-07-10 鸿富锦精密工业(深圳)有限公司 保护文件内容安全的方法和系统
CN105763525A (zh) * 2014-12-19 2016-07-13 北大方正集团有限公司 一种识别码生成方法和识别码解密方法及装置
CN104573535B (zh) * 2015-01-04 2019-08-16 努比亚技术有限公司 一种移动终端及其提高加密效率的方法和装置
CN108197485B (zh) * 2018-01-29 2020-08-18 世纪龙信息网络有限责任公司 终端数据加密方法和系统、终端数据解密方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105022936A (zh) * 2014-04-30 2015-11-04 北京畅游天下网络技术有限公司 一种类class文件加密解密方法和装置
CN104134046A (zh) * 2014-07-29 2014-11-05 深圳市中兴移动通信有限公司 加密方法和装置
CN105100186A (zh) * 2015-04-27 2015-11-25 深圳市美贝壳科技有限公司 一种家庭云照片快速加密解密的方法
CN106250781A (zh) * 2016-07-31 2016-12-21 山东大学 一种基于虚拟机增量镜像的用户信息保护方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120995505A (zh) * 2025-07-29 2025-11-21 河南金之汇信息技术有限公司 打印文件加密与备份方法、装置、电子设备

Also Published As

Publication number Publication date
CN109299611A (zh) 2019-02-01

Similar Documents

Publication Publication Date Title
WO2020044095A1 (zh) 文件加密方法、装置、设备/终端/服务器及计算机可读存储介质
US11238165B2 (en) File encryption method, file decryption method, electronic device, and storage medium
CN111917540B (zh) 一种数据加解密方法、装置、移动终端和存储介质
US8423789B1 (en) Key generation techniques
US20140289525A1 (en) System and method for decentralized management of keys and policies
CN110855433B (zh) 基于加密算法的数据加密方法、装置及计算机设备
US12287886B2 (en) Method for file encryption, terminal, electronic device and computer-readable storage medium
US20130290731A1 (en) Systems and methods for storing and verifying security information
CN103731395A (zh) 文件的处理方法及系统
US11455404B2 (en) Deduplication in a trusted execution environment
CN104657629A (zh) 一种文件版权保护方法和设备
WO2021164167A1 (zh) 一种密钥存取方法、装置、系统、设备和存储介质
KR102387169B1 (ko) 디지털 포렌식 데이터 복호화 장치
CN117828636A (zh) 一种增强Android应用多类型敏感数据安全的方法及系统
Virvilis et al. Secure cloud storage: Available infrastructures and architectures review and evaluation
CN111831978B (zh) 一种对配置文件进行保护的方法及装置
CN108173906A (zh) 安装包下载方法、装置、存储介质及电子设备
US9697372B2 (en) Methods and apparatuses for securing tethered data
JP7481076B2 (ja) キー圧縮可能な暗号化
CN102446140B (zh) 数据处理方法和移动存储设备
CN106611130A (zh) 一种文件处理方法和装置
CN116089980A (zh) 一种ofd文档敏感信息加解密方法和系统
CN110008654A (zh) 电子文件处理方法和装置
CN101018117B (zh) 网页日志加密系统及方法
TWI885722B (zh) 用於安全溝通的方法、計算機裝置、電腦可讀取記錄媒體以及用於安全溝通的系統

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18932271

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18932271

Country of ref document: EP

Kind code of ref document: A1