CN103500294B - A kind of file encryption-decryption method and device - Google Patents

A kind of file encryption-decryption method and device Download PDF

Info

Publication number
CN103500294B
CN103500294B CN201310436266.6A CN201310436266A CN103500294B CN 103500294 B CN103500294 B CN 103500294B CN 201310436266 A CN201310436266 A CN 201310436266A CN 103500294 B CN103500294 B CN 103500294B
Authority
CN
China
Prior art keywords
file
binary stream
module
tail
user
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.)
Active
Application number
CN201310436266.6A
Other languages
Chinese (zh)
Other versions
CN103500294A (en
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.)
Ronglian Technology Group Co., Ltd
Original Assignee
UNITED ELECTRONICS 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 UNITED ELECTRONICS CO Ltd filed Critical UNITED ELECTRONICS CO Ltd
Priority to CN201310436266.6A priority Critical patent/CN103500294B/en
Publication of CN103500294A publication Critical patent/CN103500294A/en
Application granted granted Critical
Publication of CN103500294B publication Critical patent/CN103500294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Landscapes

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

Abstract

The invention discloses a kind of file encryption-decryption method and device, comprise the file that user selects needs to encrypt, read the password of user's input, and this cipher decoding is become binary stream data; Described encrypt file is resolved to binary stream, intercepts the identical document flow of size at the head of described encrypt file, tail respectively, and the document flow that this file header, tail intercept is exchanged; Head after exchanging described in the codon pair resolving to binary stream described in using, tail two parts document flow carry out xor operation respectively; Complementary operation is carried out to the file of whole described binary stream.Therefore, described file encryption-decryption method and device can the securities of guarantee information, improve the Cipher Strength to information.

Description

A kind of file encryption-decryption method and device
Technical field
The present invention relates to information security field, refer to a kind of file encryption-decryption method and device especially.
Background technology
The basic process of data encryption is exactly to being that file expressly or data process by certain algorithm originally; become unreadable one section of code; be commonly referred to " ciphertext "; make it after the corresponding key of input, just can only can demonstrate original content, reach by such approach the object that protected data do not stolen by juridical-person, reads.The inverse process of this process is deciphering, is converted into the process of its original data by this coded message.
Existing ciphering process: after the file of user's Choice encryption, judges the validity of password form, selects own cryptographic algorithm to be encrypted.Existing decrypting process: user selects the file needing deciphering, if correctly have input clear crytpographic key, is decrypted according to decipherment algorithm.If Password Input mistake, prompting user repeats to input password.Therefore, can find out that current encipher-decipher method and device at least also exist following defect:
1, after multi-enciphering, decrypting process is dumb: after multi-enciphering, and decrypting process can only be decrypted according to particular order.After carrying out first time encryption, as carried out second time or third time encryption to encrypt file, due to the restriction of cryptographic algorithm, so decrypting process must carry out in strict accordance with the inverted order of encryption.Namely if Tertiary infilling, the password of encryption is different, and in so existing process, deciphering must be first separate third time password, after successful decryption, could separate second time password, finally separate first time password.In addition, if only have recorded password, record order, could not decipher after so needing multiple trial, if encryption number of times is more, decrypting process is very difficult.
2, omnibus algorithm easily cracks: cryptographic algorithm has been open resource, is easy to crack.The cryptographic algorithm of current main flow, was attempted cracking by each layer technology fan, and therefore cryptographic algorithm itself exists the possibility that multiple spot is attacked.
3, cryptographic check process, increases and cracks probability: current technology is being decrypted in process, is mistake for bad password by prompting user cipher.Now any change is not carried out to encrypt file.Here there is certain potential safety hazard, namely because the number of times of input error password does not limit, decryption software is often through the mode of the method for exhaustion, carry out the Brute Force of password, by constantly attempting the combination of all kinds of character, cracking of password can be realized to a certain extent, add file and crack probability.
Summary of the invention
In view of this, the object of the invention is to propose a kind of file encryption-decryption method and device, can the security of guarantee information, improve the Cipher Strength to information.
Based on above-mentioned purpose a kind of file encrypting method provided by the invention, comprise the following steps:
A, user select the file needing encryption, read the password of user's input, and this cipher decoding is become binary stream data;
B, described encrypt file is resolved to binary stream, intercept the identical document flow of size at the head of described encrypt file, tail, and the document flow that this file header, tail intercept is exchanged respectively;
C, use described in resolve to binary stream codon pair described in exchange after head, tail two parts document flow carry out xor operation respectively;
D, complementary operation is carried out to the file of whole described binary stream.
Alternatively, before in stepb binary stream being resolved to described encrypt file, judge whether the size of described encrypt file is greater than 10KB, if be greater than, intercept the identical document flow of size at the head of described encrypt file, tail respectively, if be less than, return steps A.
Further, in stepb when the size of described encrypt file is greater than 10KB, the mode of described encrypt file according to binary stream is resolved, and intercept the document flow of file header 5KB and end-of-file 5KB size respectively; Then the document flow of the document flow of described file header 5KB and described end-of-file 5KB size is exchanged.
Further, first step C is several groups of data head after exchanging, tail two parts document flow being divided into respectively identical figure place, and it is identical with the password figure place of described binary stream that it often organizes figure place; Then, use described in resolve to binary stream password successively xor operation is carried out to the described often group data be divided into.
Further, in steps A, the password of user's input is the combination of numbers of 0 to 9, and password figure place is within 10.
Based on above-mentioned purpose, present invention also offers a kind of file decryption method, comprise the following steps:
A, user select the file that will decipher;
The clear crytpographic key of B, reading user input, judges that whether this clear crytpographic key is correct, if mistake, exits the described decrypting process to this file, if correct, and this cipher decoding is become binary stream data;
C, the described file entirety that will decipher to be negated;
D, entirety is negated after the described file that will decipher intercept the document flow of the identical head of size, tail, resolve to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carry out xor operation respectively;
E, the document flow of the file header will deciphered described in after carrying out xor operation, tail to be exchanged.
Alternatively, step B, after the clear crytpographic key reading user's input, needs to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data; If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key, exiting the described decrypting process to this file, directly enter into the procedure that this file is encrypted recited above, again encrypting adding this overstocked file.
Based on above-mentioned purpose, present invention also offers a kind of document encrypting apparatus, comprising:
Choice encryption file module, selects for user the file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data;
Exchange module, be connected with described Choice encryption file module, for described encrypt file is resolved to binary stream, intercept the identical document flow of size at the head of described encrypt file, tail respectively, and the document flow that this file header, tail intercept is exchanged;
XOR module, is connected with described module of exchanging, for resolve to binary stream described in using codon pair described in exchange after head, tail two parts document flow carry out xor operation respectively;
Negating module, being connected with described XOR module, for carrying out complementary operation to the file of whole described binary stream.
Based on above-mentioned purpose, present invention also offers a kind of file deciphering device, comprising:
Select declassified document module, select the file that will decipher for user.
Clear crytpographic key read module, being connected with described selection declassified document module, for reading the clear crytpographic key of user's input, judging that whether this clear crytpographic key is correct, if mistake, exit the described decrypting process to this file, if correct, this clear crytpographic key is resolved to binary stream data;
Negating module, being connected with described clear crytpographic key read module, for negating to the described file entirety that will decipher;
XOR module, be connected with described module of negating, intercept the document flow of the identical head of size, tail for the file that will decipher described after negating to entirety, resolve to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carry out xor operation respectively;
Exchange module, be connected with described XOR module, for the document flow of the file header will deciphered described in after carrying out xor operation, tail is exchanged.
Alternatively, in the process that described clear crytpographic key read module is decrypted at the file selected user, after the clear crytpographic key reading user's input, need to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data; If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key, and described clear crytpographic key read module is connected with the Choice encryption file module in encryption device recited above, this wrong clear crytpographic key is considered as Crypted password by described Choice encryption file module, again encrypts adding this overstocked file.
As can be seen from above, a kind of file encryption-decryption method provided by the invention and device, user selects the file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data; Described encrypt file is resolved to binary stream, intercepts the identical document flow of size at the head of described encrypt file, tail respectively, and the document flow that this file header, tail intercept is exchanged; Head after exchanging described in the codon pair resolving to binary stream described in using, tail two parts document flow carry out xor operation respectively; Complementary operation is carried out to the file of whole described binary stream.Thus file encryption-decryption method of the present invention and device propose brand-new encipher-decipher method and device, enhance security, are not easily cracked simultaneously.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of a kind of file encrypting method of the embodiment of the present invention;
The schematic diagram that Fig. 2 is embodiment of the present invention file header, tail is exchanged;
Fig. 3 is the schematic diagram of head after the embodiment of the present invention is exchanged, the grouping of tail two parts document flow;
Fig. 4 is the schematic flow sheet of a kind of file decryption method of the embodiment of the present invention;
Fig. 5 is the structural representation of a kind of document encrypting apparatus of the embodiment of the present invention;
Fig. 6 is the structural representation of a kind of file deciphering device of the embodiment of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with specific embodiment, and with reference to accompanying drawing, the present invention is described in more detail.
Consult shown in Fig. 1, be the schematic flow sheet of a kind of file encrypting method of the embodiment of the present invention, the described file encrypting method based on document flow comprises:
Step 101, user selects the file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data.Preferably, the password of user's input is the combination of numbers of 0 to 9, and password figure place is within 10.
Step 102, resolves to binary stream by described encrypt file, intercepts the identical document flow of size respectively, and the document flow that this file header, tail intercept exchanged at the head of described encrypt file, tail.
In one embodiment of the invention, generally the attribute data of file needs to take 5KB, and at the head of this file.Therefore, preferably before binary stream is resolved to described encrypt file, judge whether the size of described encrypt file is greater than 10KB, if be greater than, intercept the identical document flow of size at the head of described encrypt file, tail respectively, if be less than, return step 101.Preferably, when the size of described encrypt file is greater than 10KB, the mode of encrypt file according to binary stream is resolved, intercept the document flow (as shown in Figure 2) of file header 5KB and end-of-file 5KB size respectively, then the document flow of the document flow of file header 5KB and end-of-file 5KB size is exchanged.Now, the file attribute data being recorded in described file header have been transferred on end-of-file, and file attribute has changed not identifiable design into.
Step 103, the head after exchanging described in the codon pair resolving to binary stream described in using, tail two parts document flow carry out xor operation respectively.
In another embodiment of the present invention, first the head after exchanging, tail two parts document flow are divided into respectively several groups of data of identical figure place, it is identical with the password figure place of described binary stream that it often organizes figure place.Then, the password resolving to binary stream is used to carry out xor operation to the described often group data be divided into successively.Preferably, when the password figure place of the described not binary stream of last group be divided into, several are so had just to carry out xor operation with binary coded corresponding former positions.
Such as, the password of user's input is 123, changes into binary code and is 1111011, and so now the file header document flow after exchanging being divided into every 7 scale-of-two is one group (as shown in Figure 3), carries out xor operation successively with the binary mode of password.When last inadequate 7 of group, only have 4, so just carry out xor operation with binary coded corresponding first 4.
Step 104, carries out complementary operation to the file of whole described binary stream.
In another embodiment of the present invention, carry out entirety for the file after completing steps 103 and negate, such as, if this file after step 103 becomes 1101010001, then become 0010101110 after negating.
Consult shown in Fig. 4, be the schematic flow sheet of a kind of file decryption method of the embodiment of the present invention, according to the ciphering process of described file described above, be described the decryption method of described file, its decryption method comprises:
Step 401, user selects the file that will decipher.
Step 402, reads the clear crytpographic key of user's input, judges that whether this clear crytpographic key is correct, if mistake, exits the described decrypting process to this file, if correct, and this cipher decoding is become binary stream data.
As an alternative embodiment of the invention, in the process that the file selected user is decrypted, step 402, after the clear crytpographic key reading user's input, needs to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data.If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key.Preferably, when the clear crytpographic key mistake of user's input, exiting the described decrypting process to this file, directly enter into the procedure that this file is encrypted recited above, namely again encrypting adding this overstocked file.Can find out, bad password will be performed cryptographic operation, eliminate the process of prompting user input error password, the substitute is and utilize bad password again to encrypt.Namely after user's input error password, by encryption method, file will be carried out to encryption again.This addresses the problem the approach being carried out password cracking by the method for exhaustion.
Step 403, negates to the described file entirety that will decipher.
Step 404, after negating to entirety, the described file that will decipher intercepts the document flow of the identical head of size, tail, resolves to the file header, the tail document flow that intercept described in the codon pair of binary stream and carry out xor operation respectively described in using.
In an embodiment of the present invention, the size of the file header intercepted described in it, tail document flow is identical with the size of the file header intercepted during this file encryption, tail document flow.Preferably, the file header will deciphered described in intercepting, the document flow of each 5KB size of tail.
Preferably, when resolving to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carrying out xor operation, be file header, tail document flow are divided into groups respectively, it is identical with the password figure place of described binary stream that it often organizes figure place.Then, the password resolving to binary stream is used to carry out xor operation to the described often group data be divided into successively.When the password figure place of the described not binary stream of last group be divided into, several are so had just to carry out xor operation with binary coded corresponding former positions.
Step 405, exchanges the document flow of the file header will deciphered described in after carrying out xor operation, tail.
In one embodiment of the invention, because the described file that will decipher is in its process be encrypted, is be transferred on end-of-file to recording the file attribute data being arranged on file header, makes file attribute change not identifiable design into.Therefore, after the step 405 be decrypted this file, make file attribute data recall to file header from end-of-file, reduction end-of-file readable state.
It should be noted that, because the present invention carries out encryption and decryption based on the document flow of file, the decrypting process after therefore repeatedly encrypting for a file can be deciphered according to random order, and does not need to carry out according to the inverted order of repeatedly encrypting completely.That is: as Tertiary infilling, in the correct situation of password of deciphering, the order not requirement of input password.As long as number of times and password are correctly, the sequence of definitive document can be reduced according to source document, avoids user and forgets the continuous trial that the sequencing of key causes.Because, document flow is a kind of binary data stream, and no matter carry out what kind of operation, after its operation of every, result is not 1 is exactly 0, so do not need to carry out according to the inverted order of repeatedly encrypting to the file decryption utilizing above-mentioned encryption method repeatedly to encrypt, make decrypting process very flexible.
Consult shown in Fig. 5, be the structural representation of a kind of document encrypting apparatus of the embodiment of the present invention, described document encrypting apparatus comprises:
Choice encryption file module 501, user can select by this Choice encryption file module 501 file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data.Preferably, the password of user's input is the combination of numbers of 0 to 9, and password figure place is within 10.
Exchange module 502, be connected with Choice encryption file module 501, described encrypt file can be resolved to binary stream, intercept the identical document flow of size at the head of described encrypt file, tail respectively, and the document flow that this file header, tail intercept is exchanged.Its concrete function comprises:
In one embodiment of the invention, generally the attribute data of file needs to take 5KB, and at the head of this file.Therefore, preferably before binary stream is resolved to described encrypt file, judge whether the size of described encrypt file is greater than 10KB, if be greater than, intercept the identical document flow of size at the head of described encrypt file, tail respectively, if be less than, Choice encryption file module 501 reselects the file needing encryption.Preferably, when the size of described encrypt file is greater than 10KB, the mode of encrypt file according to binary stream is resolved, intercepts the document flow of file header 5KB and end-of-file 5KB size respectively, then the document flow of the document flow of file header 5KB and end-of-file 5KB size is exchanged.Now, the file attribute data being recorded in described file header have been transferred on end-of-file, and file attribute has changed not identifiable design into.
XOR module 503, and exchanges module 502 and is connected, and the head after exchanging described in the codon pair resolving to binary stream described in described XOR module 503 can use, tail two parts document flow carry out xor operation respectively.Its concrete function comprises:
In another embodiment of the present invention, first by after exchanging head, tail two parts document flow be divided into several groups of data of identical figure place respectively, it is identical with the password figure place of described binary stream that it often organizes figure place.Then, the password resolving to binary stream is used to carry out xor operation to the described often group data be divided into successively.Preferably, when the password figure place of the described not binary stream of last group be divided into, several are so had just to carry out xor operation with binary coded corresponding former positions.
Such as, the password of user's input is 123, changes into binary code and is 1111011, and so now the file header document flow after exchanging being divided into every 7 scale-of-two is one group (as shown in Figure 3), carries out xor operation successively with the binary mode of password.When last inadequate 7 of group, only have 4, so just carry out xor operation with binary coded corresponding first 4.
To negate module 504, be connected with XOR module 503, complementary operation can be carried out to the file of whole described binary stream.
In another embodiment of the present invention, carry out entirety for the file after XOR module 503 process and negate, such as, if this file after XOR module 503 processes becomes 1101010001, then become 0010101110 after negating.
Consult shown in Fig. 6, be the structural representation of a kind of file deciphering device of the embodiment of the present invention, described file deciphering device comprises:
Select declassified document module 601, user can select by described selection declassified document module 601 file that will decipher.
Clear crytpographic key read module 602, be connected with selection declassified document module 601, described clear crytpographic key read module 602 can read the clear crytpographic key of user's input, judge that whether this clear crytpographic key is correct, if mistake, exit the described decrypting process to this file, if correct, this clear crytpographic key is resolved to binary stream data.Its concrete function comprises:
As an alternative embodiment of the invention, in the process that the file selected user is decrypted, after the clear crytpographic key reading user's input, need to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data.If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key.
Preferably, when the clear crytpographic key mistake of user's input, exit the described decrypting process to this file, now clear crytpographic key read module 602 is connected with Choice encryption file module 501, this wrong clear crytpographic key is considered as Crypted password by described Choice encryption file module 501, and this wrong clear crytpographic key is resolved to binary stream data.Namely entering in the process that this file is encrypted recited above, again encrypting adding this overstocked file.Can find out, bad password will be performed cryptographic operation, eliminate the process of prompting user input error password, the substitute is and utilize bad password again to encrypt.Namely after user's input error password, by encryption method, file will be carried out to encryption again.This addresses the problem the approach being carried out password cracking by the method for exhaustion.
To negate module 603, be connected with clear crytpographic key read module 602, the described file entirety that will decipher is negated.
XOR module 604, module 603 is connected with negating, after negating to entirety, the described file that will decipher intercepts the document flow of the identical head of size, tail, resolves to the file header, the tail document flow that intercept described in the codon pair of binary stream and carry out xor operation respectively described in using.Its concrete function comprises:
In an embodiment of the present invention, the size of the file header intercepted described in it, tail document flow is identical with the size of the file header intercepted during this file encryption, tail document flow.Preferably, the file header will deciphered described in intercepting, the document flow of each 5KB size of tail.
Preferably, when resolving to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carrying out xor operation, be file header, tail document flow are divided into groups respectively, it is identical with the password figure place of described binary stream that it often organizes figure place.Then, the password resolving to binary stream is used to carry out xor operation to the described often group data be divided into successively.When the password figure place of the described not binary stream of last group be divided into, several are so had just to carry out xor operation with binary coded corresponding former positions.
Exchange module 605, be connected with XOR module 604, the file header will deciphered described in after XOR module 604 is carried out xor operation, the document flow of tail are exchanged.Its concrete function comprises:
In one embodiment of the invention, because the described file that will decipher is in its process be encrypted, is be transferred on end-of-file to recording the file attribute data being arranged on file header, makes file attribute change not identifiable design into.Therefore, when being decrypted this file, make file attribute data recall to file header from end-of-file, reduction end-of-file readable state.
According to above describedly, a kind of file encryption-decryption method that the present invention proposes and device, creationaryly propose the brand-new file encryption-decryption method based on document flow and device, creatively the mode sorted based on document flow is combined with the password that user inputs, realize the process of file encryption-decryption; Encipher-decipher method of the present invention and device itself have stronger uniqueness; And the present invention, when being decrypted the file repeatedly encrypted, only needs user to remember each password, and do not need the order of remembeing that it is encrypted several times, convenient for users to use, improve the experience satisfaction of user; Also this invention is made to use more flexible; Simultaneously, there is hidden danger in traditional encryption, decryption method, by modes such as the methods of exhaustion, can crack the file encrypted, for solving this hidden danger, strengthen the security of encrypt file, can not prompting be made to the clear crytpographic key of mistake, but exit decrypting process, directly enter into the process that this file is encrypted above, namely again encrypting adding this overstocked file, strengthening further the security of file, thus independence is higher not easily cracks; Meanwhile, this innovation and creation ground carries out operational processes for file attribute data, makes whole file not identifiable design, not only ingenious but also achieve the splendid effect of file security; Finally, whole described file encryption-decryption method and device easy, compact, be easy to realize.
Those of ordinary skill in the field are to be understood that: the foregoing is only specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (6)

1. a file decryption method, is characterized in that, comprises the following steps:
A, user select the file that will decipher;
The clear crytpographic key of B, reading user input, judges that whether this clear crytpographic key is correct, if mistake, exits the described decrypting process to this file, if correct, and this cipher decoding is become binary stream data;
C, the described file entirety that will decipher to be negated;
D, entirety is negated after the described file that will decipher intercept the document flow of the identical head of size, tail, resolve to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carry out xor operation respectively;
E, the document flow of the file header will deciphered described in after carrying out xor operation, tail to be exchanged;
Wherein, step B, after the clear crytpographic key reading user's input, needs to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data; If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key, exiting the described decrypting process to this file, directly enter into the procedure that this file is encrypted, again encrypting adding this overstocked file;
Wherein, the method for described encryption comprises step:
The first step, user selects the file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data;
Second step, resolves to binary stream by described encrypt file, intercepts the identical document flow of size respectively, and the document flow that this file header, tail intercept exchanged at the head of described encrypt file, tail;
3rd step, the head after exchanging described in the codon pair resolving to binary stream described in using, tail two parts document flow carry out xor operation respectively;
4th step, carries out complementary operation to the file of whole described binary stream.
2. decryption method according to claim 1, it is characterized in that, before binary stream being resolved to described encrypt file in step 2, judge whether the size of described encrypt file is greater than 10KB, if be greater than, intercept the identical document flow of size at the head of described encrypt file, tail respectively, if be less than, return step one.
3. decryption method according to claim 2, it is characterized in that, in step 2 when the size of described encrypt file is greater than 10KB, the mode of described encrypt file according to binary stream is resolved, and intercept the document flow of file header 5KB and end-of-file 5KB size respectively; Then the document flow of the document flow of described file header 5KB and described end-of-file 5KB size is exchanged.
4. decryption method according to claim 2, is characterized in that, first step 3 is several groups of data head after exchanging, tail two parts document flow being divided into respectively identical figure place, and it is identical with the password figure place of described binary stream that it often organizes figure place; Then, use described in resolve to binary stream password successively xor operation is carried out to the described often group data be divided into.
5. the decryption method according to Claims 1-4 any one, is characterized in that, in step one, the password of user's input is the combination of numbers of 0 to 9, and password figure place is within 10.
6. a file deciphering device, is characterized in that, comprising:
Select declassified document module, the file that will decipher is selected for user, clear crytpographic key read module, be connected with described selection declassified document module, for reading the clear crytpographic key of user's input, judge that whether this clear crytpographic key is correct, if mistake, exit the described decrypting process to this file, if correct, this clear crytpographic key is resolved to binary stream data;
Negating module, being connected with described clear crytpographic key read module, for negating to the described file entirety that will decipher;
XOR module, be connected with described module of negating, intercept the document flow of the identical head of size, tail for the file that will decipher described after negating to entirety, resolve to the file header, the tail document flow that intercept described in the codon pair of binary stream described in using and carry out xor operation respectively;
Exchange module, be connected with described XOR module, for the document flow of the file header will deciphered described in after carrying out xor operation, tail is exchanged;
Wherein, in the process that described clear crytpographic key read module is decrypted at the file selected user, after the clear crytpographic key reading user's input, need to judge the clear crytpographic key of user's input, if correct, this clear crytpographic key is resolved to binary stream data; If incorrect, exit the described decrypting process to this file, user can not be pointed out to have input wrong clear crytpographic key, and described clear crytpographic key read module is connected with encryption device;
Wherein, described encryption device comprises:
Choice encryption file module, selects for user the file needing encryption, reads the password of user's input, and this cipher decoding is become binary stream data;
Exchange module, be connected with described Choice encryption file module, for described encrypt file is resolved to binary stream, intercept the identical document flow of size at the head of described encrypt file, tail respectively, and the document flow that this file header, tail intercept is exchanged;
XOR module, is connected with described module of exchanging, for resolve to binary stream described in using codon pair described in exchange after head, tail two parts document flow carry out xor operation respectively;
Negating module, being connected with described XOR module, for carrying out complementary operation to the file of whole described binary stream;
Wherein, described clear crytpographic key read module is connected with the Choice encryption file module in this encryption device, and this wrong clear crytpographic key is considered as Crypted password by described Choice encryption file module, again encrypts adding this overstocked file.
CN201310436266.6A 2013-09-23 2013-09-23 A kind of file encryption-decryption method and device Active CN103500294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310436266.6A CN103500294B (en) 2013-09-23 2013-09-23 A kind of file encryption-decryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310436266.6A CN103500294B (en) 2013-09-23 2013-09-23 A kind of file encryption-decryption method and device

Publications (2)

Publication Number Publication Date
CN103500294A CN103500294A (en) 2014-01-08
CN103500294B true CN103500294B (en) 2016-03-23

Family

ID=49865502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310436266.6A Active CN103500294B (en) 2013-09-23 2013-09-23 A kind of file encryption-decryption method and device

Country Status (1)

Country Link
CN (1) CN103500294B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125056A (en) * 2014-08-07 2014-10-29 肖龙旭 Data encryption and decryption method
CN104268480A (en) * 2014-10-10 2015-01-07 重庆邮电大学 XML (extensive markup language) configuration file security protection processing method and system
CN104463019B (en) * 2014-12-29 2017-07-25 北京致远互联软件股份有限公司 The encipher-decipher method of electronic document
CN104750675B (en) * 2015-04-01 2017-09-26 山东省计算中心(国家超级计算济南中心) A kind of unknown format encrypts the recognition methods of file
CN105893864A (en) * 2015-12-10 2016-08-24 乐视网信息技术(北京)股份有限公司 Data file confusion method and system, and client side
CN106022147A (en) * 2016-05-26 2016-10-12 珠海市魅族科技有限公司 Method and device for file encryption and decryption

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1445681A (en) * 2003-05-01 2003-10-01 南京邮电学院 Encryption, decryption method using high security level symmetry secret key algorithm and its encipherer
CN1133297C (en) * 1995-09-26 2003-12-31 林仙坎 A kind of file encryption processing method
CN101803270A (en) * 2007-07-31 2010-08-11 雷蒙德·吉恩·克利福德·阿图斯 Method and system for encryption of data
CN102025484A (en) * 2010-12-17 2011-04-20 北京航空航天大学 Block cipher encryption and decryption method
CN102983972A (en) * 2012-10-18 2013-03-20 郎六琪 Dynamic encryption and decryption method based on stream cipher

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080104417A1 (en) * 2006-10-25 2008-05-01 Nachtigall Ernest H System and method for file encryption and decryption

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1133297C (en) * 1995-09-26 2003-12-31 林仙坎 A kind of file encryption processing method
CN1445681A (en) * 2003-05-01 2003-10-01 南京邮电学院 Encryption, decryption method using high security level symmetry secret key algorithm and its encipherer
CN101803270A (en) * 2007-07-31 2010-08-11 雷蒙德·吉恩·克利福德·阿图斯 Method and system for encryption of data
CN102025484A (en) * 2010-12-17 2011-04-20 北京航空航天大学 Block cipher encryption and decryption method
CN102983972A (en) * 2012-10-18 2013-03-20 郎六琪 Dynamic encryption and decryption method based on stream cipher

Also Published As

Publication number Publication date
CN103500294A (en) 2014-01-08

Similar Documents

Publication Publication Date Title
CN103500294B (en) A kind of file encryption-decryption method and device
CN100576196C (en) Content enciphering method, system and utilize this encryption method that the method for content is provided by network
CN107733656A (en) A kind of cipher authentication method and device
CN103546289B (en) USB (universal serial bus) Key based secure data transmission method and system
CN103778590B (en) Using digital picture storage and the method and apparatus of transmission information
CN101447870B (en) Safe storage method of private key based on technology of distributed password
CN102684877B (en) A kind of method and device carrying out user profile process
CN101227275A (en) Enciphering method for combining accidental enciphering and exhaust algorithm decipher
CN104322003B (en) Cryptographic authentication and identification method using real-time encryption
CN104281815B (en) The method and system of file encryption-decryption
JPS62283742A (en) Data transmission
CN104868996A (en) Data encryption and decryption method, device thereof, and terminal
JP6489464B2 (en) Optical code, information transmission method, and authentication method
CN103618705A (en) Personal code managing tool and method under open cloud platform
CN102833075A (en) Identity authentication and digital signature method based on three-layered overlapping type key management technology
CN104219044A (en) Key secret method for encrypting storing device
JP2012181645A (en) Authentication server, authentication program, and authentication system
CN107333262A (en) A kind of system and method based on CN39 code authentication phone numbers
CN104640091B (en) A kind of SMS encryption communication method
CN103281299A (en) Encryption and decryption devices and information processing method and system
CN100459495C (en) Password dynamic enciphering inputmethod of public emipering mode
CN112199699A (en) Character string encryption and decryption method and device, storage medium and processor
CN104955029A (en) Address book protection method, address book protection device and communication system
CN105279447A (en) Method and device for data encryption, and method and device for data decryption
CN102332978B (en) Lottery ticket off-line verification system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 1002-1, 10th floor, No.56, Beisihuan West Road, Haidian District, Beijing 100080

Patentee after: Ronglian Technology Group Co., Ltd

Address before: 100080, Beijing, Haidian District, No. 56 West Fourth Ring Road, glorious Times Building, 10, 1002-1

Patentee before: UNITED ELECTRONICS Co.,Ltd.

CP03 Change of name, title or address