CN109670323A - A kind of file encrypting method, decryption method and device - Google Patents

A kind of file encrypting method, decryption method and device Download PDF

Info

Publication number
CN109670323A
CN109670323A CN201811502770.0A CN201811502770A CN109670323A CN 109670323 A CN109670323 A CN 109670323A CN 201811502770 A CN201811502770 A CN 201811502770A CN 109670323 A CN109670323 A CN 109670323A
Authority
CN
China
Prior art keywords
file
encrypted
byte stream
user
decrypted
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.)
Pending
Application number
CN201811502770.0A
Other languages
Chinese (zh)
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.)
Golden Melon Seed Technology Development (beijing) Co Ltd
Original Assignee
Golden Melon Seed Technology Development (beijing) Co 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 Golden Melon Seed Technology Development (beijing) Co Ltd filed Critical Golden Melon Seed Technology Development (beijing) Co Ltd
Priority to CN201811502770.0A priority Critical patent/CN109670323A/en
Publication of CN109670323A publication Critical patent/CN109670323A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Landscapes

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

Abstract

Present disclose provides a kind of file encrypting method, decryption method and devices.Wherein, encryption method, comprising: the corresponding binary word throttling of file to be encrypted is obtained from local first file that user specifies;The corresponding binary word throttling binary system byte stream corresponding with Crypted password set by user for the file to be encrypted that will acquire carries out operation, obtains the corresponding binary system encryption byte stream of encrypted file;Encrypted file is stored in local second file specified to user, and file to be encrypted is deleted from the first file.In this way, may be implemented it is efficient, easily file is encrypted.

Description

A kind of file encrypting method, decryption method and device
Technical field
This disclosure relates to file ciphering technology field, in particular to a kind of file encrypting method, decryption method and dress It sets.
Background technique
In the prior art, when user encrypts photo, the image etc. that store in this ground of mobile phone, used mode Usually the photo upload to cloud is encrypted, for example is uploaded to Baidu's cloud etc., another way is by setting to photograph album The mode for setting opening password is encrypted;Wherein, although first way has certain safety, need user that will shine Piece carries out being uploaded to cloud, and efficiency is relatively low;In second of mode to photograph album setting opening password, if stored in the photograph album There is part without photo to be encrypted, if user needs to open such photo and watches, still to input and open password opening Photograph album could be watched, therefore there is also have certain inconvenience.
Summary of the invention
The disclosure provides a kind of file encrypting method, decryption method and device, to solve encryption method in the prior art The problem of existing inconvenience.
In a first aspect, present disclose provides a kind of file encrypting methods, comprising:
The corresponding binary word throttling of file to be encrypted is obtained from local first file that user specifies;
The corresponding binary word throttling for the file to be encrypted that will acquire is corresponding with Crypted password set by user Binary system byte stream carries out operation, obtains the corresponding binary system encryption byte stream of encrypted file;
By the corresponding binary system encryption byte stream of the encrypted file store to the user specify local second In file, and the file to be encrypted is deleted from first file.
A kind of file encrypting method that the disclosure provides, by the throttling of the file to be encrypted of acquisition corresponding binary word and The corresponding binary system byte stream of Crypted password set by user carries out operation, to be encrypted in the first file specified to user There is user can independently select to carry out file to be encrypted, and encrypt convenient good effect for file encryption.
Second aspect, present disclose provides a kind of file decryption methods, comprising:
The file to be decrypted in the second file and the clear crytpographic key of user's input are obtained, the file to be decrypted is corresponding Throttle corresponding with clear crytpographic key binary system byte stream of binary word carry out inverse operation, obtain decrypting file corresponding two System byte stream;
Export the binary word throttling.
A kind of file decryption method that the disclosure provides will be to be decrypted by obtaining the file to be decrypted in the second file The corresponding binary word throttling of file binary system byte stream corresponding with the clear crytpographic key that user inputs carries out inverse operation, is solved The corresponding binary word throttling of ciphertext part, and the binary system byte stream is exported, the file after being decrypted, and then realize The file encrypted by above-mentioned encryption method is decrypted.
The third aspect, present disclose provides a kind of encryption devices, comprising:
First obtains module, for reading the corresponding binary word of file to be encrypted from the first file that user specifies Throttling;
Computing module, for according to reading the corresponding binary word throttling of the file to be encrypted and it is set by user plus The corresponding binary system byte stream of password carries out operation, obtains the corresponding binary system encryption byte stream of encrypted file;
Memory module refers to for storing the corresponding binary system encryption byte stream of the encrypted file to the user In the second fixed file, and when the file to be encrypted is deleted from first file.
A kind of document encrypting apparatus that the disclosure provides, by the throttling of the file to be encrypted of acquisition corresponding binary word and The corresponding binary system byte stream of Crypted password set by user carries out operation, to be encrypted in the first file specified to user There is user can independently select to carry out file to be encrypted, and encrypt convenient good effect for file encryption.
Fourth aspect, the disclosure provide a kind of decryption device, comprising:
Second obtains module, for obtaining the file to be decrypted in the second file, the file to be decrypted is corresponding Binary word throttling binary system byte stream corresponding with the password that user inputs carries out inverse operation, obtains decryption file corresponding two System byte stream;
Output module, for exporting the binary word throttling.
A kind of decryption device that the disclosure provides, by obtaining the file to be decrypted in the second file, by file to be decrypted Corresponding binary word throttles binary system byte stream progress inverse operation corresponding with the clear crytpographic key that user input, obtains solving ciphertext Part corresponding binary word throttling, and the binary system byte stream being exported, the file after being decrypted, so realize by It is decrypted by the file that above-mentioned encryption method encrypts.
5th aspect, the disclosure provide a kind of computer equipment, including memory, processor and are stored in the memory Computer program that is upper and can running on the processor, the processor is realized above-mentioned when executing the computer program The step of method.
A kind of computer equipment that the disclosure provides, is able to carry out above-mentioned file encrypting method or file decryption side Method, this document encryption method may be implemented file in the first file specified according to user and encrypt, and pass through ciphertext to be added The corresponding binary word throttling of part binary word throttling corresponding with Crypted password set by user is treated encryption file and is added It is close, there is user can independently select to carry out file to be encrypted, and the convenient good effect of ciphering process.
6th aspect, present disclose provides a kind of computer readable storage medium, on the computer readable storage medium It is stored with computer program, the computer program executes above-mentioned method when being run by processor the step of.
A kind of computer readable storage medium that the disclosure provides, is able to carry out above-mentioned file encryption, file decryption side Method, the encryption method may be implemented file in the first file specified according to user and encrypt, and pass through file pair to be encrypted The corresponding binary word throttling of the binary byte stream and Crypted password set by user answered is treated encryption file and is encrypted, It can independently select to carry out file to be encrypted, and the convenient good effect of ciphering process with user.
To enable the above objects, features, and advantages of the disclosure to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
In order to illustrate more clearly of the technical solution of the disclosure, letter will be made to attached drawing needed in the embodiment below It singly introduces, it should be understood that the following drawings illustrates only some embodiments of the disclosure, therefore is not construed as to range It limits, it for those of ordinary skill in the art, without creative efforts, can also be according to these attached drawings Obtain other relevant attached drawings.
Fig. 1 shows a kind of flow diagram of file encrypting method of disclosure offer;
Fig. 2 shows a kind of flow diagrams for file decryption method that the disclosure provides;
Fig. 3 shows a kind of structural schematic diagram of document encrypting apparatus of disclosure offer;
Fig. 4 shows a kind of structural schematic diagram of file deciphering device of disclosure offer;
Fig. 5 shows the structural schematic diagram of the computer equipment of disclosure offer.
Specific embodiment
To keep the purposes, technical schemes and advantages of the disclosure clearer, below in conjunction with attached drawing in the disclosure, to this public affairs Technical solution in opening is clearly and completely described, it is clear that described embodiment is only that disclosure a part is implemented Example, instead of all the embodiments.The component for the disclosure being usually described and illustrated herein in the accompanying drawings can be with various differences Configuration arrange and design.Therefore, the detailed description of the embodiment of the disclosure provided in the accompanying drawings is not intended to below Claimed the scope of the present disclosure is limited, but is merely representative of the selected embodiment of the disclosure.Based on embodiment of the disclosure, Those skilled in the art's every other embodiment obtained without making creative work, belongs to the disclosure The range of protection.
Fig. 1 is a kind of flow diagram of file encrypting method provided by the disclosure.Shown in referring to Fig.1, this method packet Include following steps:
S100, the corresponding binary word throttling of file to be encrypted is obtained from local first file that user specifies.
Be stored with file to be encrypted in above-mentioned first file, the file to be encrypted can refer to image, text or Video etc..
Specifically, what above-mentioned binary word throttling was made of binary system byte, reading tool by byte stream can be with Read the binary word throttling of image, text etc.;In the present embodiment, the first text that tool is specified from user is read by byte stream The corresponding byte stream of file to be encrypted is read in part folder, which, which reads tool, can be java tool-class.
S102, the corresponding binary word throttling of file to be encrypted that will acquire and Crypted password set by user are corresponding Binary system byte stream carry out operation, obtain encrypted file corresponding binary system encryption byte stream.
The above-mentioned corresponding binary word throttling binary system corresponding with Crypted password set by user by file to be encrypted Byte stream carries out operation, can upset the corresponding binary word throttling of file to be encrypted, and then play the role of encryption.
The corresponding binary word throttling of above-mentioned file to be encrypted is the content-data and formatted data of the file to be encrypted Corresponding binary word throttling.
Due to byte stream be binary form (such as a byte stream be 01,111,100 0000110010011010 11111110), therefore the operation between above-mentioned byte stream and Crypted password is substantially bit arithmetic;Therefore, above-mentioned user sets The Crypted password set needs to have specific format, which, which meets the Crypted password, to flow into binary system byte Row operation;In specific implementation, it can be and prompt user according to the template or reference of setting in user setting Crypted password Format inputs Crypted password;Be also possible to user input Crypted password after, according to scheduled conversion regime (such as using MD5 carries out coded treatment) Crypted password that user inputs is converted into carry out the data format of operation with byte stream, i.e., will Crypted password set by user is converted into its corresponding binary word throttling.
In one embodiment of the disclosure, above-mentioned steps S102 includes the following steps A100:
It is A100, the corresponding binary word throttling of the file to be encrypted is corresponding with the Crypted password set by user Binary system byte stream carries out and operation, obtains the corresponding binary system encryption byte stream of encrypted file.
In the embodiment of the present disclosure, added by the corresponding binary word throttling of the file to be encrypted that will acquire with set by user The corresponding binary system byte stream of password be simple and efficient file encryption to be encrypted with the mode of operation.It is obtained above Encrypted file is to be disturbed the corresponding binary word throttling of later file to be encrypted, realizes and adds to the upset of file It is close.
It is above-mentioned to be also possible to format into Crypted password set by user in the possible embodiment of the disclosure one After binary word throttling, the corresponding binary word of the Crypted password is inserted into the corresponding byte stream of above-mentioned file to be encrypted Throttling;It is also possible to binary system byte corresponding with Crypted password that the above-mentioned corresponding binary word of file to be encrypted throttles Stream progress or operation etc., to achieve the purpose that encryption.
Therefore it should be noted that between the corresponding byte stream and Crypted password set by user of above-mentioned file to be encrypted Operation mode there are many, it is not limited here.
S104, the corresponding binary system encryption byte stream of the encrypted file is stored into the local specified to the user In second file, and the file to be encrypted is deleted from first file.
In the present embodiment, the corresponding binary system encryption byte stream of above-mentioned encrypted file is the encryption file after being disturbed Byte stream.Encrypted file is stored in the second file being located locally that user specifies;The encrypted file Status display in the second file is be already encrypted or impaired file.
A kind of file encrypting method provided in the embodiment of the present disclosure, user can will need the file that encrypts store to In first file, in ciphering process, the file to be encrypted in first file is obtained by circulation and is encrypted, then Encrypted file is stored into the second file.After file in first file is encrypted, this document is literary from first It is deleted in part folder, if the file to be encrypted in the first encryption folder all encrypts after completing, the shape of first file State is shown as empty.
File encrypting method provided by above-mentioned, user can independently select that the file encrypted is needed to encrypt, be not necessarily to File is uploaded to cloud to encrypt, also avoids in the prior art, needing to unite when encrypting the photo in photograph album It is inconvenient brought by one encryption, and encrypt with safe and efficient good effect.
In one optional embodiment of the disclosure, by the encrypted file store to the user specify local the After in two files, the above method further includes following steps B100:
B100, encrypted term is set for each encrypted file in second file.
In the present embodiment, it is that encrypted term is arranged in each encrypted file in the second file, further improves guarantor Close effect.
In one optional embodiment of the disclosure, above-mentioned each encrypted file setting encryption in second file Time limit specifically comprises the following steps B1001-B1002:
B1001, third file is established in second file, it is hiding that the attribute of the third file, which is arranged,.
The attribute of above-mentioned third file is hiding, and then the third file is not open to user;The third file Format can be record.txt.
If all encrypted file encrypted terms having the same in B1002, second file, obtain The encrypted term of all encrypted files set by user, the encrypted term is stored in the third file.
In the present embodiment, user can be with the encrypted term of encrypted file, if all encrypted files have phase The encrypted term, is directly stored in above-mentioned third file by same encrypted term at this time, in case using when decryption.
In another possible embodiment of the disclosure, above-mentioned each encrypted file in second file is set Encrypted term is set, specifically comprises the following steps C100-C102:
C100, the third file in second file, it is hiding that the attribute of the third file, which is arranged,.
If the encrypted file in C102, second file is respectively provided with different encrypted terms, obtain The encrypted term of the encrypted file set by user, by the mark of the encrypted file and the encrypted text The encrypted term correspondence of part is stored in the third file.
In the embodiment of the present disclosure, if the encrypted file in the second above-mentioned file is respectively provided with different encryptions When the time limit, i.e., user is provided with different encrypted terms to different encrypted files, then by the mark of encrypted file It carries out correspondence with the encrypted term of the encrypted file to be stored in the third file of above-mentioned foundation, and then convenient in decryption When can obtain the encrypted term of each encrypted file respectively.The mark of above-mentioned encrypted file can be encryption The number etc. of the filename of file afterwards either file.
Fig. 2 shows a kind of flow diagrams for file decryption method that the embodiment of the present disclosure provides.Referring to shown in Fig. 2, This method comprises the following steps S200-S202:
S200, the file to be decrypted in the second file and the clear crytpographic key of user's input are obtained, by the text to be decrypted The corresponding binary word throttling of part binary system byte stream corresponding with the clear crytpographic key carries out inverse operation, obtains decryption file pair The binary word throttling answered.
Specifically, above-mentioned by the corresponding binary word throttling corresponding with the clear crytpographic key that user inputs two of file to be decrypted System byte stream carries out inverse operation, comprising: by the decryption of the file to be encrypted corresponding binary word throttling and user's input The corresponding binary system byte stream of password carries out or operation (i.e. with the inverse operation of operation), obtains the corresponding byte stream of decryption file.
S202, the output binary word throttling.
In the present embodiment, if user input clear crytpographic key it is consistent with initial Crypted password, above-mentioned output two into Byte stream processed can be with before file encryption to be decrypted binary word throttling it is consistent, if the file to be decrypted is photo, User opens tool, that is, openable photo by photo at this time.If the clear crytpographic key and Crypted password of user's input are different Cause, the throttling of the binary word of above-mentioned output with the binary word throttling before file encryption to be decrypted be it is inconsistent, use at this time Tool can be shown when being opened as messy code, or can not open this document.
In one embodiment of the disclosure, in above-mentioned steps S200, throttle by the corresponding binary word of the file to be decrypted Further include following steps D100-D102 before binary system byte stream corresponding with the clear crytpographic key carries out inverse operation:
D100, judge whether be only stored with encrypted term in third file in second file, if so, from described The encrypted term is read in third file in second file.
D102, it is calculated and is sealed up for safekeeping according to the encryption times stamp of the encrypted term and the file to be decrypted in encryption Timestamp, however, it is determined that current time stamp be greater than it is described seal timestamp up for safekeeping, execute it is described by the file corresponding two to be decrypted into The step of byte stream processed binary system byte stream corresponding with the clear crytpographic key carries out inverse operation.
In the embodiment of the present disclosure, if being only stored with encrypted term in above-mentioned third file, the encryption phase is directly acquired Limit is calculated according to the encryption times stamp of the encrypted term and file to be decrypted in encryption and seals timestamp up for safekeeping, and by the envelope It deposits timestamp to be compared with current timestamp, when current time stamp, which is greater than or equal to, seals timestamp up for safekeeping, illustrate to be decrypted The encryption times of file have been over encrypted term, execute at this time above-mentioned by the corresponding binary word throttling of file to be decrypted Binary system byte stream corresponding with clear crytpographic key carries out inverse operation, can be decrypted.The time is sealed up for safekeeping when current time stamp is less than When stamp, illustrates that the encrypted event of file to be decrypted is also not up to encrypted term, do not execute at this time above-mentioned by file pair to be decrypted The binary word throttling binary system byte stream corresponding with clear crytpographic key answered carries out inverse operation, i.e., can not decrypt.
In another embodiment of the disclosure, in above-mentioned steps S200, described by the file to be decrypted and user's input Further include following steps E100-E102 before password carries out inverse operation:
E100, judge the mark that file to be decrypted whether is stored in third file in second file, if so, The mark for obtaining file to be decrypted matches the corresponding encrypted term of the file to be decrypted according to the mark.
E102, it is calculated and is sealed up for safekeeping according to the encryption times stamp of the encrypted term and the file to be decrypted in encryption Timestamp, however, it is determined that current time stamp be greater than it is described seal timestamp up for safekeeping, execute it is described by the file corresponding two to be decrypted into The step of byte stream processed binary system byte stream corresponding with the clear crytpographic key carries out inverse operation.
In the present embodiment, if there is also the marks for having file to be decrypted in third file, can obtain will currently solve at this time The mark of close file to be decrypted matches the corresponding encrypted term of the file to be decrypted according to the mark.Then basis should add The encryption times stamp of close time limit and file to be decrypted in encryption is calculated and seals timestamp up for safekeeping, and is determining that current time stamp is big When this seals timestamp up for safekeeping, the corresponding binary word throttling of file to be decrypted binary system byte corresponding with clear crytpographic key is flowed into Row inverse operation.
Fig. 3 shows a kind of structural schematic diagram of document encrypting apparatus of disclosure offer.Referring to shown in Fig. 3, the encryption Device, comprising:
First obtain module 301, for read from the first file that user specifies file to be encrypted corresponding two into Byte stream processed;
Computing module 302, for according to reading the corresponding binary word throttling of the file to be encrypted and user set The corresponding binary system byte stream of Crypted password carry out operation, obtain the corresponding binary system encryption byte stream of encrypted file;
Memory module 303, for storing the corresponding binary system encryption byte stream of the encrypted file to the use In the second specified file of family, and the file to be encrypted is deleted from first file.
In one optional embodiment of the disclosure, above-mentioned apparatus, further includes:
Encrypted term setup module, for encrypted term to be arranged for each encrypted file in second file.
In one optional embodiment of the disclosure, above-mentioned encrypted term setup module is specifically used for:
Third file is established in second file, it is hiding that the attribute of the third file, which is arranged,;
If all encrypted file encrypted terms having the same in second file, obtain user and set The encrypted term of fixed all encrypted files, the encrypted term is stored in the third file.
In one optional embodiment of the disclosure, above-mentioned encrypted term setup module is specifically used for:
Third file is established in second file, it is hiding that the attribute of the third file, which is arranged,;
If the encrypted file in second file is respectively provided with different encrypted terms, obtains user and set The encrypted term of fixed encrypted file, by the mark of the encrypted file and the encryption phase of the encrypted file Limit correspondence is stored in the third file.
In one optional embodiment of the disclosure, above-mentioned computing module is specifically used for:
By the corresponding binary word throttling of the file to be encrypted and the Crypted password corresponding two set by user into Byte stream processed carries out and operation, obtains the corresponding binary system encryption byte stream of encrypted file.
Fig. 4 shows a kind of structural schematic diagram of file deciphering device of disclosure offer.Referring to shown in Fig. 4, the decryption Device, comprising:
Second obtains module 401, for obtaining the file to be decrypted in the second file and the clear crytpographic key of user's input, The corresponding binary word of the file to be decrypted is throttled binary system byte stream progress inverse operation corresponding with the clear crytpographic key, Obtain the corresponding binary word throttling of decryption file;
Output module 402, for exporting the binary word throttling.
In one optional embodiment of the disclosure, above-mentioned decryption device, further includes:
First judgment module, for judging whether be only stored with the encryption phase in the third file in second file Limit, if so, reading the encrypted term from the third file in second file;
First computing module, for being stabbed according to the encryption times of the encrypted term and the file to be decrypted in encryption It is calculated and seals timestamp up for safekeeping, determine that current time stamp seals timestamp up for safekeeping described in being greater than.
In one optional embodiment of the disclosure, above-mentioned decryption device, further includes:
Second judgment module, for judging whether be stored with file to be decrypted in the third file in second file Mark the file to be decrypted corresponding encryption phase is matched according to the mark if so, obtain the mark of file to be decrypted Limit;
Second computing module, when for for according to the encryption in encryption of the encrypted term and the file to be decrypted Between stamp be calculated and seal timestamp up for safekeeping, determine that current time stamp is greater than and described seal timestamp up for safekeeping.
In one optional embodiment of the disclosure, above-mentioned second obtains module, is specifically used for:
The corresponding binary word of the file to be decrypted binary system byte corresponding with the clear crytpographic key that throttles is flowed into Capable or operation.
Fig. 5 shows the structural schematic diagram of the computer equipment of disclosure offer.As shown in figure 5, one embodiment of the disclosure A kind of computer equipment provided, for executing the file encryption in Fig. 1, Fig. 2, decryption method, which includes memory 1000, processor 2000 and it is stored in the computer program that can be run on the memory 1000 and on the processor 2000, In, the step of above-mentioned processor 2000 realizes above-mentioned file encryption, decryption method when executing above-mentioned computer program.
Specifically, above-mentioned memory 1000 and processor 2000 can be general memory and processor, not do here It is specific to limit, when the computer program of 2000 run memory 2000 of processor storage, it is able to carry out above-mentioned file encryption, solution Decryption method is added so that user can independently select that the file encrypted is needed to encrypt it is not necessary that file is uploaded to cloud It is close, it also avoids in the prior art, it is inconvenient brought by unified encryption to need when encrypting to the photo in photograph album, and Encryption has safe and efficient good effect.
Corresponding to file encryption of the Fig. 1 into Fig. 2, decryption method, the disclosure additionally provides a kind of computer-readable storage Medium is stored with computer program on the computer readable storage medium, executes when which is run by processor The step of stating file encryption, file decryption method.
Specifically, which can be general storage medium, such as mobile disk, hard disk, on the storage medium Computer program when being run, above-mentioned file encryption, file decryption method are able to carry out, so that user can independently select to need The file to be encrypted is encrypted, and is encrypted it is not necessary that file is uploaded to cloud, is also avoided in the prior art, to photograph album In photo need when being encrypted inconvenient brought by unified encryption, and encrypt there is safe and efficient good effect.
In the embodiment provided by the disclosure, it should be understood that disclosed device and method, it can also be by other Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown According to device, the architectural framework in the cards of method and computer program product, function of multiple embodiments of the disclosure And operation.In this regard, each box in flowchart or block diagram can represent one of a module, section or code Point, a part of the module, section or code includes one or more for implementing the specified logical function executable Instruction.It should also be noted that function marked in the box can also be attached to be different from some implementations as replacement The sequence marked in figure occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes may be used To execute in the opposite order, this depends on the function involved.It is also noted that each of block diagram and or flow chart The combination of box in box and block diagram and or flow chart can be based on the defined function of execution or the dedicated of movement The system of hardware is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the disclosure can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the disclosure is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the disclosure all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The above, the only specific embodiment of the disclosure, but the protection scope of the disclosure is not limited thereto, it is any Those familiar with the art can easily think of the change or the replacement in the technical scope that the disclosure discloses, and should all contain It covers within the protection scope of the disclosure.Therefore, the protection scope of the disclosure should be subject to the protection scope in claims.

Claims (13)

1. a kind of file encrypting method characterized by comprising
The corresponding binary word throttling of file to be encrypted is obtained from local first file that user specifies;
The corresponding binary word of the file to be encrypted that will acquire throttles binary system corresponding with Crypted password set by user Byte stream carries out operation, obtains the corresponding binary system encryption byte stream of encrypted file;
The corresponding binary system encryption byte stream of the encrypted file is stored into local second file specified to the user In folder, and the file to be encrypted is deleted from first file.
2. the method according to claim 1, wherein referring to storing the encrypted file to the user After in fixed local second file, the method also includes:
For each encrypted file in second file, encrypted term is set.
3. according to the method described in claim 2, it is characterized in that, each encrypted text in second file Encrypted term is arranged in part, comprising:
Third file is established in second file, it is hiding that the attribute of the third file, which is arranged,;
If all encrypted file encrypted terms having the same in second file, obtain set by user The encrypted term is stored in the third file by the encrypted term of all encrypted files.
4. according to the method described in claim 2, it is characterized in that, each encrypted text in second file Encrypted term is arranged in part, comprising:
Third file is established in second file, it is hiding that the attribute of the third file, which is arranged,;
If the encrypted file in second file is respectively provided with different encrypted terms, obtain set by user The encrypted term of the encrypted file, by the mark of the encrypted file and the encryption phase of the encrypted file Limit correspondence is stored in the third file.
5. method according to claim 1 to 4, which is characterized in that pair of the file to be encrypted that will acquire The binary word throttling binary system byte stream corresponding with Crypted password set by user answered carries out operation, obtains encrypted text The corresponding binary system of part encrypts byte stream, comprising:
By the corresponding binary word throttling of the file to be encrypted binary word corresponding with the Crypted password set by user Throttling carries out and operation, obtains the corresponding binary system encryption byte stream of encrypted file.
6. a kind of file decryption method characterized by comprising
The file to be decrypted in the second file and the clear crytpographic key of user's input are obtained, by the file corresponding two to be decrypted System byte stream binary system byte stream corresponding with the clear crytpographic key carries out inverse operation, obtains the corresponding binary system of decryption file Byte stream;
Export the binary word throttling.
7. according to the method described in claim 6, it is characterized in that, described by the corresponding binary word of the file to be decrypted Before the binary system byte stream corresponding with the clear crytpographic key that throttles carries out inverse operation, the method also includes:
Judge whether be only stored with encrypted term in the third file in second file, if so, from second file The encrypted term is read in third file in folder;
It is calculated according to the encryption times stamp of the encrypted term and the file to be decrypted in encryption and seals timestamp up for safekeeping, if Determine current time stamp be greater than it is described seal timestamp up for safekeeping, execute it is described will the corresponding binary word throttling of the file to be decrypted and The step of corresponding binary system byte stream of the clear crytpographic key carries out inverse operation.
8. according to the method described in claim 6, it is characterized in that, described by the corresponding binary word of the file to be decrypted Before the binary system byte stream corresponding with the clear crytpographic key that throttles carries out inverse operation, the method also includes:
Judge whether be stored with the mark of file to be decrypted in the third file in second file, if so, obtaining wait solve The mark of ciphertext part matches the corresponding encrypted term of the file to be decrypted according to the mark;
It is calculated according to the encryption times stamp of the encrypted term and the file to be decrypted in encryption and seals timestamp up for safekeeping, if Determine current time stamp be greater than it is described seal timestamp up for safekeeping, execute it is described will the corresponding binary word throttling of the file to be decrypted and The step of corresponding binary system byte stream of the clear crytpographic key carries out inverse operation.
9. according to method as claimed in claim 6 to 8, which is characterized in that by the corresponding binary word of the file to be decrypted The binary system byte stream corresponding with the clear crytpographic key that throttles carries out inverse operation, comprising:
By the corresponding binary word of the file to be decrypted throttle binary system byte stream progress corresponding with the clear crytpographic key or Operation.
10. a kind of encryption device characterized by comprising
First obtains module, for reading the corresponding binary system byte of file to be encrypted from the first file that user specifies Stream;
Computing module, for close according to the corresponding binary word throttling of file to be encrypted of reading and encryption set by user The corresponding binary system byte stream of code carries out operation, obtains the corresponding binary system encryption byte stream of encrypted file;
Memory module is specified for storing the corresponding binary system encryption byte stream of the encrypted file to the user In second file, and the file to be encrypted is deleted from first file.
11. a kind of decryption device characterized by comprising
Second obtain module, for obtaining the file to be decrypted in the second file, by the file corresponding two to be decrypted into Byte stream processed binary system byte stream corresponding with the password that user inputs carries out inverse operation, obtains the corresponding binary system of decryption file Byte stream;
Output module, for exporting the binary word throttling.
12. a kind of computer readable storage medium, computer program, the meter are stored on the computer readable storage medium Calculation machine program executes the claim 1 to 9 described in any item methods when being run by processor.
13. a kind of computer equipment, including memory, processor and it is stored on the memory and can be on the processor The computer program of operation, which is characterized in that the processor realized when executing the computer program the claims 1 to The step of 9 described in any item methods.
CN201811502770.0A 2018-12-10 2018-12-10 A kind of file encrypting method, decryption method and device Pending CN109670323A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811502770.0A CN109670323A (en) 2018-12-10 2018-12-10 A kind of file encrypting method, decryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811502770.0A CN109670323A (en) 2018-12-10 2018-12-10 A kind of file encrypting method, decryption method and device

Publications (1)

Publication Number Publication Date
CN109670323A true CN109670323A (en) 2019-04-23

Family

ID=66143654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811502770.0A Pending CN109670323A (en) 2018-12-10 2018-12-10 A kind of file encrypting method, decryption method and device

Country Status (1)

Country Link
CN (1) CN109670323A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032818A (en) * 2021-05-27 2021-06-25 北京国电通网络技术有限公司 Task encryption method and device, electronic equipment and computer readable medium
CN113239371A (en) * 2021-04-29 2021-08-10 广州群志科技股份有限公司 Method for preventing face data from divulging secret

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1350255A (en) * 2001-11-29 2002-05-22 上海维豪信息安全技术有限公司 Official document circulating system based on goverment affairs trust and authorized service
US20100150352A1 (en) * 2008-12-15 2010-06-17 Ebay, Inc. Secure self managed data (ssmd)
CN103294961A (en) * 2013-06-07 2013-09-11 北京奇虎科技有限公司 Method and device for file encrypting/decrypting
CN104281815A (en) * 2013-07-05 2015-01-14 中国移动通信集团北京有限公司 Method and system for encrypting and decrypting file
CN107171797A (en) * 2017-07-18 2017-09-15 郑州云海信息技术有限公司 A kind of data ciphering method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1350255A (en) * 2001-11-29 2002-05-22 上海维豪信息安全技术有限公司 Official document circulating system based on goverment affairs trust and authorized service
US20100150352A1 (en) * 2008-12-15 2010-06-17 Ebay, Inc. Secure self managed data (ssmd)
CN103294961A (en) * 2013-06-07 2013-09-11 北京奇虎科技有限公司 Method and device for file encrypting/decrypting
CN104281815A (en) * 2013-07-05 2015-01-14 中国移动通信集团北京有限公司 Method and system for encrypting and decrypting file
CN107171797A (en) * 2017-07-18 2017-09-15 郑州云海信息技术有限公司 A kind of data ciphering method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
文件封存时间舱: "《http://xiazai.sogou.com/detail/34/9/1030414614957182026.html?uID=5845F942E33D990A000000005DCE3ECC&euid=%3Cfont%20color=&w=2111》", 9 October 2010 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239371A (en) * 2021-04-29 2021-08-10 广州群志科技股份有限公司 Method for preventing face data from divulging secret
CN113032818A (en) * 2021-05-27 2021-06-25 北京国电通网络技术有限公司 Task encryption method and device, electronic equipment and computer readable medium

Similar Documents

Publication Publication Date Title
US11709948B1 (en) Systems and methods for generation of secure indexes for cryptographically-secure queries
US11782911B1 (en) Systems and methods for cryptographically-secure queries using filters generated by multiple parties
US7873838B2 (en) Method, apparatus, and program product for flexible redaction of content
US7865742B2 (en) Method, apparatus, and program product for enabling access to flexibly redacted content
US7861096B2 (en) Method, apparatus, and program product for revealing redacted information
CN105245328B (en) It is a kind of that management method is generated based on the key of third-party user and file
CN103927357B (en) Data encryption and retrieval method for database
CN104134046B (en) encryption method and device
CN104298932B (en) A kind of call method and device of SO files
CN103400064B (en) For file encryption and the method and apparatus of deciphering
CN102819716B (en) Method, device and system for encrypting and decrypting picture
CN106571905A (en) Numeric data homomorphic order-preserving encryption method
EP3732609A1 (en) Secure crypto system attributes
CN103338445A (en) File encryption and decryption method and system
WO2018006576A1 (en) Method for protecting pdf document page-by-page
CN107180197A (en) file operation method and device
TW201329776A (en) System and method for protection of file content security
CN109670323A (en) A kind of file encrypting method, decryption method and device
CN104142803A (en) Method for copy-protected storage of information on a data carrier
CN103095449A (en) Dynamic encryption and decryption method based on stream ciphers
CN104168435B (en) The method and system that a kind of audio file batch merges and played
Belenko et al. “Secure Password Managers” and “Military-Grade Encryption” on Smartphones: Oh, Really?
CN106022143B (en) A kind of method, apparatus and system of the operation of database level of confidentiality mark security gateway
Park et al. A methodology for the decryption of encrypted smartphone backup data on android platform: A case study on the latest samsung smartphone backup system
CN105790928B (en) A kind of file splitting method based on digital digest

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190423

RJ01 Rejection of invention patent application after publication