CN100591007C - Encryption and decryption method - Google Patents
Encryption and decryption method Download PDFInfo
- Publication number
- CN100591007C CN100591007C CN200710184824A CN200710184824A CN100591007C CN 100591007 C CN100591007 C CN 100591007C CN 200710184824 A CN200710184824 A CN 200710184824A CN 200710184824 A CN200710184824 A CN 200710184824A CN 100591007 C CN100591007 C CN 100591007C
- Authority
- CN
- China
- Prior art keywords
- block
- encryption
- point
- data
- ciphertext
- 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
Links
Images
Landscapes
- Storage Device Security (AREA)
Abstract
An encryption method is provided, which comprise, firstly selecting a plurality of pioneer blocks from a plurality of data blocks for forming data and selecting a plurality of data blocks from the residual data blocks; then encrypting a first data block in the selected data blocks based on at least one of the pioneer blocks to obtain a first ciphertext; and further encrypting a second data block in the selected data blocks based on at least one of the pioneer blocks to obtain a second ciphertext. The obtained ciphertext can be used as the pioneer block during the subsequent data block encryption process.
Description
Technical field
The invention relates to a kind of encrypt and decrypt method, and be particularly to a kind of method of utilizing data self content to carry out encrypt and decrypt.
Background technology
In cryptography, major part all is to adopt the mechanism of symmetry (Symmetric) or asymmetric (Asymmetric) enciphering/deciphering.For instance, symmetrical encryption/decryption algorithm comprises RC4, DES and aes algorithm.In symmetrical encryption/decryption algorithm, be to use same golden key (Key) when enciphered data and data decryption.Asymmetric encryption/decryption algorithm comprises RSA Algorithm.In asymmetric encryption/decryption algorithm, enciphered data is to use different golden key (PKI and private key) during with data decryption., for asymmetric encryption/decryption algorithm, how to transmit golden key and will form important consideration on safe for symmetry.Though asymmetric encryption/decryption algorithm can have preferable fail safe than symmetrical encryption/decryption algorithm, yet its relative complexity also promotes.
In some encryption/decryption algorithm,, can not use golden key when enciphered data and data decryption as replacing in (Substitution) encryption/decryption algorithm.Fig. 1 shows that one replaces the schematic diagram of encryption/decryption algorithm.As shown in Figure 1, in the ciphertext that the foundation encryption/decryption algorithm produces, a letter will be replaced by the another one letter.For instance, A is replaced or the like by Q by S replacement, D by G replacement, C by V replacement, B.For replacing encryption/decryption algorithm, ciphertext is very easy to crack by analyzing continually, and it has lower fail safe.
Summary of the invention
In view of this, the invention provides the encrypt and decrypt method.
The encryption method of the embodiment of the invention.At first, partition data is to produce a plurality of block.In a plurality of block of forming data, select a plurality of first block.By selecting second block in the remaining block.Afterwards, by selecting at least one in first block.Encrypt for second block according to the first selected block, thereby obtain first ciphertext.
The decryption method of the embodiment of the invention.At first, in a plurality of block of forming data, select first block.By selecting second block in the remaining block.Afterwards, be decrypted for second block according to first block, thereby obtain the first flat literary composition.
In certain embodiments, the ciphertext of generation can be as point's block in the encipheror of follow-up data block.
Said method of the present invention can be included in physical medium by the procedure code mode.When procedure code was loaded and carries out by machine, machine became in order to carry out device of the present invention.
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, embodiment cited below particularly, and cooperate appended diagram, be described in detail as follows.
Description of drawings
Fig. 1 is that a schematic diagram is to show that one replaces encryption/decryption algorithm.
Fig. 2 is that a flow chart is the encryption method that shows according to the embodiment of the invention.
Fig. 3 is that a flow chart is the decryption method that shows according to the embodiment of the invention.
Fig. 4 A show the number when point's block be 1 and the encryption of block be the encryption example that carries out the XOR computing for block.
Among Fig. 4 B displayed map 4A the number of point's block be 1 and the encryption of block be the deciphering example that carries out the ciphertext of XOR computing for block.
Fig. 5 A show the number when point's block be 2 and the encryption of block be the encryption example that carries out the XOR computing for block.
Among Fig. 5 B displayed map 5A the number of point's block be 2 and the encryption of block be the deciphering example that carries out the ciphertext of XOR computing for block.
[main element label declaration]
S210, S220 ..., S280~operating procedure;
S310, S320 ..., S380~operating procedure.
Embodiment
Fig. 2 shows the encryption method according to the embodiment of the invention.In this embodiment, data can be encrypted according to self content.
As step S210, data are divided into a plurality of block.It should be noted that each block can have identical length, as 1 (Bit), 1 byte (Byte) or other size.In certain embodiments, each block can also have length inequality.As step S220, by selecting one or a plurality of block in the block, with as point (Sentry) block.What note is, point's block is the golden key when being used as other block and encrypting.In certain embodiments, point's block can be identical with original block, or original block is handled in advance.For instance, carry out logical operation for block, as XOR, AND, OR, and NOT etc., or according to encryption/decryption algorithm, as replacing encryption/decryption algorithm, symmetrical encryption/decryption algorithm or asymmetric encryption/decryption algorithm enciphered data block.
As step S230, by selecting at least one block in the remaining block.As step S240, by selecting at least one in point's block, and, encrypt for selected block according to selected point's block as step S250, thus the ciphertext of obtaining.It should be noted that, block is encrypted and can be carried out logical operation for block according to point's block, or according to encryption/decryption algorithm, as replacing encryption/decryption algorithm, symmetrical encryption/decryption algorithm or asymmetric encryption/decryption algorithm enciphered data block.
As step S260, judge whether the encryption operation of corresponding data finishes.Must be noted that in certain embodiments, after all selected mistake of the block of all data, the then encryption end of job of corresponding data.In certain embodiments, after the selected mistake of the block of prearranged number in the data, the then encryption end of job of corresponding data.If the encryption end of job (step S260 is) of corresponding data, process ends.If the encryption operation of corresponding data finishes (step S260 denys) as yet,, judge whether and the ciphertext that step S250 produces must be made as point's block as step S270.Mandatory declaration be whether ciphertext can be selected will be as point's block in the encipheror of follow-up data block, to increase the kenel and the complexity of encipheror.If the ciphertext that produces need not be made as point's block (step S270 not), flow process is got back to step S230, selects at least one block in the remaining data block by non-selected mistake still again, to carry out encipheror.If the ciphertext that produces need be made as point's block (step S270 is), as step S280, ciphertext is made as point's block, and flow process is got back to step S230, again by selecting at least one block in the remaining data block of non-selected mistake still, to carry out encipheror.
What must remind is that the selected and order of point's block, selected order and the relevant information of block will be recorded in encipheror, use so that the data decryption ginseng to be provided.
Fig. 3 shows the decryption method according to the embodiment of the invention.In this embodiment, data can be decrypted according to self content.
As step S310, data are divided into a plurality of block.It should be noted that each block can have identical length, as 1,1 byte or other size.In certain embodiments, each block can also have length inequality.As step S320, by selecting one or a plurality of block in the block, with as point's block.What note is, point's block is the golden key when being used as other block and being decrypted.In certain embodiments, point's block can be identical with original block, or original block is handled in advance.For instance, carry out logical operation for block, as XOR, AND, OR, and NOT etc., or according to encryption/decryption algorithm, as replacing encryption/decryption algorithm, symmetrical encryption/decryption algorithm or asymmetric encryption/decryption algorithm enciphered data block.
As step S330, by selecting at least one block in the remaining block.As step S340, by selecting at least one in point's block, and, be decrypted for selected block according to selected point's block, thereby obtain a flat literary composition as step S350.It should be noted that, block is decrypted and can carries out logical operation for block according to point's block, or according to encryption/decryption algorithm, as replacing encryption/decryption algorithm, symmetrical encryption/decryption algorithm or asymmetric encryption/decryption algorithm data decryption block.
As step S360, judge whether the deciphering operation of corresponding data finishes.Must be noted that in certain embodiments, after all selected mistake of the block of all data, the then deciphering end of job of corresponding data.In certain embodiments, after the selected mistake of the block of prearranged number in the data, the then deciphering end of job of corresponding data.If the deciphering end of job (step S360 is) of corresponding data, process ends.If the deciphering operation of corresponding data finishes (step S360 denys) as yet,, judge whether and the flat literary composition that step S350 produces must be made as point's block as step S370.If the flat literary composition that produces need not be made as point's block (step S370 not), flow process is got back to step S330, selects at least one block in the remaining data block by non-selected mistake still again, to be decrypted program.If the flat literary composition that produces need be made as point's block (step S370 is), as step S380, will put down literary composition and be made as point's block, and flow process is got back to step S330, again by selecting at least one block in the remaining data block of non-selected mistake still, to be decrypted program.
Next, proposing example describes.
Fig. 4 A show the number when point's block be 1 and the encryption of block be the encryption example that carries out the XOR computing for block.Shown in Fig. 4 A, the block of wherein flat literary composition be X1, X2, X3 ..., Xn, the block of ciphertext be Y1, Y2, Y3 ..., Yn.In this example, X1 is chosen to be point's block, and point's block is identical with the content of original data block, so Y1=X1.Then, block X2 is selected, and is encrypted as ciphertext according to point's block Y1
Ciphertext Y2 is set as point's block.Afterwards, block X3 is selected, and is encrypted as ciphertext according to point's block Y2
Ciphertext Y3 is set as point's block.Said procedure repeats, and Xn is selected until block, and is encrypted as ciphertext according to point's block Yn-1
Among Fig. 4 B displayed map 4A the number of point's block be 1 and the encryption of block be the deciphering example that carries out the ciphertext of XOR computing for block.Shown in Fig. 4 B, wherein the block of ciphertext be Y1, Y2, Y3 ..., Yn, the block of flat literary composition be X1, X2, X3 ..., Xn.In this example, Y1 is chosen to be point's block, and point's block is identical with the content of original data block, so X1=Y1.Then, block Y2 is selected, and is flat literary composition according to point's block X1 deciphering
Flat civilian X2 is set as point's block.Afterwards, block Y3 is selected, and is flat literary composition according to point's block X2 deciphering
Flat civilian X3 is set as point's block.Said procedure repeats, and Yn is selected until block, and is flat literary composition according to point's block Xn-1 deciphering
Fig. 5 A show the number when point's block be 2 and the encryption of block be the encryption example that carries out the XOR computing for block.Shown in Fig. 5 A, the block of wherein flat literary composition be X1, X2, X3 ..., Xn, the block of ciphertext be Y1, Y2, Y3 ..., Yn.In this example, X1 and Xn are chosen as simultaneously and are decided to be point's block, and point's block is identical with the content of original data block, so Y1=X1 and Yn=Xn.Encryption operation that it should be noted that corresponding data can be launched by two ends respectively.Block X2 is selected, and is encrypted as ciphertext according to point's block Y1
Ciphertext Y2 is set as point's block.On the other hand, block Xn-1 is selected, and is encrypted as ciphertext according to point's block Yn
Ciphertext Yn-1 is set as point's block.Said procedure repeats, until the selected and encryption of all flat civilian block.Among Fig. 5 B displayed map 5A the number of point's block be 2 and the encryption of block be the deciphering example that carries out the ciphertext of XOR computing for block.Shown in Fig. 5 B, wherein the block of ciphertext be Y1, Y2, Y3 ..., Yn, the block of flat literary composition be X1, X2, X3 ..., Xn.In this example, Y1 and Yn are chosen as simultaneously and are decided to be point's block, and point's block is identical with the content of original data block, so X1=Y1 and Xn=Yn.Similarly, the deciphering operation of corresponding data can be launched by two ends respectively.Block Y2 is selected, and is flat literary composition according to point's block X1 deciphering
Flat civilian X2 is set as point's block.On the other hand, block Yn-1 is selected, and is flat literary composition according to point's block Xn deciphering
Flat civilian Xn-1 is set as point's block.Said procedure repeats, the selected and deciphering until all encrypt data blocks.
Method of the present invention, or specific kenel or its part, can be contained in physical medium with the kenel of procedure code, get (as embodied on computer readable) Storage Media as floppy disk, discs, hard disk or any other machine readable, wherein, when procedure code by machine, when loading and carrying out as computer, this machine becomes in order to realize device of the present invention.Method and apparatus of the present invention also can be with the procedure code kenel by some transfer mediums, transmit as electric wire or cable, optical fiber or any transmission kenel, wherein, when procedure code by machine, when receiving, loading and carrying out as computer, this machine becomes in order to realize device of the present invention.When the general service processor is done in fact, the procedure code associative processor provides a class of operation to be similar to the unique apparatus of using particular logic circuit.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limit the present invention; any those skilled in the art; without departing from the spirit and scope of the present invention; when can doing a little change and retouching, so protection scope of the present invention is as the criterion when looking appended the claim scope person of defining.
Claims (10)
1. an encryption method comprises the following steps:
Partition data is to produce a plurality of block;
By selecting a plurality of first block in described a plurality of block;
By selecting second block in remaining described a plurality of block;
By selecting at least one in described a plurality of first block; And
Encrypt for this second block according to this selected first block, thereby obtain first ciphertext,
Selected and the order of first block, selected order and the relevant information of block will be recorded in encipheror, use so that the data decryption ginseng to be provided.
2. encryption method according to claim 1 also comprises the following steps:
By selecting the 3rd block in remaining described a plurality of block; And
Encrypt for the 3rd block according to this first ciphertext, thereby obtain second ciphertext.
3. encryption method according to claim 1 also is included in before this second block encryption, carries out logical operation for this first block.
4. encryption method according to claim 1 also is included in before this second block encryption, encrypts this first block for this first block according to encryption/decryption algorithm.
5. encryption method according to claim 1, wherein encrypting for this second block according to this first block is to carry out logical operation for this second block.
6. encryption method according to claim 1, wherein encrypting for this second block according to this first block is to encrypt this second block according to encryption/decryption algorithm.
7. a decryption method corresponding with the encryption method of claim 1 comprises the following steps:
In a plurality of block of forming data, select first block;
By selecting second block in remaining described a plurality of block; And
Be decrypted for this second block according to this first block, thereby obtain the first flat literary composition.
8. decryption method according to claim 7 also comprises the following steps:
By selecting the 3rd block in remaining described a plurality of block; And
Be decrypted for the 3rd block according to this first flat literary composition, thereby obtain the second flat literary composition.
9. decryption method according to claim 7 also is included in before this second block deciphering, carries out logical operation for this first block.
10. decryption method according to claim 7 also is included in before this second block deciphering, deciphers this first block for this first block according to encryption/decryption algorithm.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710184824A CN100591007C (en) | 2007-10-30 | 2007-10-30 | Encryption and decryption method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710184824A CN100591007C (en) | 2007-10-30 | 2007-10-30 | Encryption and decryption method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101159548A CN101159548A (en) | 2008-04-09 |
CN100591007C true CN100591007C (en) | 2010-02-17 |
Family
ID=39307484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200710184824A Active CN100591007C (en) | 2007-10-30 | 2007-10-30 | Encryption and decryption method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100591007C (en) |
-
2007
- 2007-10-30 CN CN200710184824A patent/CN100591007C/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN101159548A (en) | 2008-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8416947B2 (en) | Block cipher using multiplication over a finite field of even characteristic | |
US7945049B2 (en) | Stream cipher using multiplication over a finite field of even characteristic | |
CN107086915B (en) | Data transmission method, data sending end and data receiving end | |
CN104205117B (en) | device file encryption and decryption method and device | |
US20120269340A1 (en) | Hierarchical encryption/decryption device and method thereof | |
CN101622816A (en) | Flexible architecture and instruction for advanced encryption standard (AES) | |
CN109245881A (en) | A kind of photograph video cloud encryption storage method | |
US7925009B2 (en) | Hybrid data encryption | |
CN102546156A (en) | Method, system and device for grouping encryption | |
CN106598882A (en) | Secure memory data protection method and device | |
Singh | Modified Vigenere encryption algorithm and its hybrid implementation with Base64 and AES | |
WO2007001075A1 (en) | Encryption device, encryption method, decryption device, decryption method, and data structure | |
CN104732159A (en) | File processing method and file processing device | |
CN108418684A (en) | A kind of character string symmetric cryptography and decryption method | |
CN103152362A (en) | Cloud-computing-based encrypted transmission method for large data files | |
US20100124328A1 (en) | Extensive ciphertext feedback | |
US20090257583A1 (en) | Cipher feedback with variable block chaining | |
Soni et al. | Key generation using genetic algorithm for image encryption | |
CN102394746B (en) | Data transmission method of weighing system based on digital sensor | |
CN102377563A (en) | Method for data stream encryption | |
Vinay et al. | Implementation of DNA cryptography based on dynamic DNA sequence table using cloud computing | |
CN100591007C (en) | Encryption and decryption method | |
Kar et al. | An improved data security using DNA sequencing | |
JP6203387B2 (en) | Encryption device, storage system, decryption device, encryption method, decryption method, encryption program, and decryption program | |
JP2013098722A (en) | Ciphering device of stream cipher, deciphering device of stream cipher, ciphering method of stream cipher, deciphering method of stream cipher, and program |
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 |